But remember.before looking at the solution you need to try the problem on. String ab1=B.substring(0,1). This video contains solution to HackerRank 'Java substring comparisons' problem. ![]() String ab=A.substring(0,1).toUpperCase() When you capitalize the first letter of both and and then print them separated by a space, you get "Hello Java". When sorted alphabetically/lexicographically, "hello" precedes "java" therefore, is not greater than and the answer is No. Has a length of, and has a length of the sum of their lengths is. ![]() For this challenge, the test is not case-sensitive. In this HackerRank Java Anagrams problem in the java programming language, Two strings, a and b, are called anagrams if they contain all the same characters in the same frequencies. įor the second line, write Yes if is lexicographically greater than otherwise print No instead.įor the third line, capitalize the first letter in both and and print them on a single line, separated by a space. HackerRank Java Anagrams problem solution. The strings are comprised of only lowercase English letters.įor the first line, sum the lengths of and.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |