Anagrams - Part 03

preview_player
Показать описание
To access the translated content:
The video course content can be accessed in the form of regional language text transcripts, books which can be accessed under downloads of each course, subtitles in the video and Video Text Track below the video.
2. Regional language subtitles available for this course
To watch the subtitles in regional languages:
1. Click on the lecture under Course Details.
2. Play the video.
3. Now click on the Settings icon and a list of features will display
4. From that select the option Subtitles/CC.
5. Now select the Language from the available languages to read the subtitle in the regional language.
Рекомендации по теме
Комментарии
Автор

It may not always give the correct output.
for e.g. sum of ASCII values of the string "bcd" and "ace" is same but they are not anagrams

shobhitgupta
Автор

Better run a loop through each word of first string and check if it is in 2nd string or not

i_m_trial
Автор

This code is wrong lol. As per this code the sum of the ASCII values should be equal
They havent even set a limit that the length of the strings should be equal
Clearly, 1 + 2 + 3 = 6
And, 5 + 1 = 6, They are obviously not anagrams
Also even if we use strings of same length, this will not always work as
KLM and JLN have same sum
A better solution would be to convert the strings into a set of their chars and check if they're equal. (in length too)

garvitsingh
Автор

wrong! correct approach is to use hashing

Satya.