Question
Link to the actual page. please make sure you get full point : http://codecheck.it/files?repo=fall2017&problem=q2 Implement the method Strings.uniqueLetters(String str) that returns a string of those
Link to the actual page. please make sure you get full point :
http://codecheck.it/files?repo=fall2017&problem=q2
Implement the method Strings.uniqueLetters(String str) that returns a string of those letters that only occur once in str, in the same order that they appear in the original. For example, uniqueLetters("harrasses") should return "he" since the letters a, r, and s occur multiple times.
Complete the following file:
Strings.java
public class Strings { public static String uniqueLetters(String str) { ... } }
Use the following file:
Tester.java
public class Tester { public static void main(String[] args) { int[] a = new int[] { 5, 4, 1, 9, 2, 6 }; Arrays.swapLargestAndSmallest(a); System.out.println(java.util.Arrays.toString(a)); System.out.println("Expected: [5, 4, 9, 1, 2, 6]"); a = new int[] {1, 4, 1, 9, 2, 6}; Arrays.swapLargestAndSmallest(a); System.out.println(java.util.Arrays.toString(a)); System.out.println("Expected: [9, 4, 1, 1, 2, 6]"); a = new int[] {1, 4, 2, 9, 9, 6}; Arrays.swapLargestAndSmallest(a); System.out.println(java.util.Arrays.toString(a)); System.out.println("Expected: [9, 4, 2, 9, 1, 6]"); a = new int[] {1}; Arrays.swapLargestAndSmallest(a); System.out.println(java.util.Arrays.toString(a)); System.out.println("Expected: [1]"); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started