1. Write a function to implement the "cat" command in Linux 2. Find the first character that only appears once in the whole string
Anonymous
1. Loop through all the characters for the string char array. 2. If you are doing this in Java, use indexOf and lastIndexOf methods. 3. If indexOf and lastIndexOf are same then you have found your first unique char. for(char character : input.toCharArray()) { if(input.indexOf(character) == input.lastIndexOf(character)) { print character; return; } }
Check out your Company Bowl for anonymous work chats.