DSA GRIND #3
DSA GRIND #3 By Ashur Baroutta This week we solved two problems. The first problem reads as follows : "Given two strings , s and t, return true if "t" is an anagram of "s", and false otherwise". An anagram is a word formed by rearranging the letters of a different word, using the original words letters exactly once (typically). To solve this I started with setting up an if condition to return false for the edge case in which the length of s did not match the length of t, as if the lengths don't match then the words are obviously not anagrams of each other. I then turned both the strings into character arrays and sorted them. After sorting, I made a for loop and checked each index for a character match, as if one failed to match I knew it was not an anagram. The code submission is shown below. I am pleased with the performance. The second problem I worked on was a bit more complicated for me though it is built in part on the pre...