10 Algorithms Courses to Crack Programming Job Interviews (courses) How to reverse words in a sentence without using a library method? (solution) How to check if String is Palindrome? (solution) How to return the highest occurred character in a String? (solution) How to reverse a String in...
1.Our first solution to the anagram problem will check tosee that each character in the first string actually occurs in the second. If it is possible to “checkoff” each character, then the two strings must be anagrams. Checking off a character(字母) will be accomplished by replacing it ...
How to Check if Two Strings are Anagrams? So, since all letters are lowercase, we can create an array of 26 integers storing the counter of appearance for each letter for the first word. Decrementing the counters for letters in the second word. Finally, we just have to check if all coun...