We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Tutorials
- 30 Days of Code
- Day 14: Scope
- Discussions
Day 14: Scope
Day 14: Scope
Sort by
recency
|
1119 Discussions
|
Please Login in order to post a comment
This is the code in java
Can someone explain to me while the following code only returns zeroes (JAVA):
public int computeDifference(){ Arrays.sort(elements); int len = elements.length-1;
C#
JAVA SOLUTION
class Difference { private int[] elements; public int maximumDifference;
}
Two solutions, one as intended and one smarter solution based off of the constraints
`
Difference(int[] elements){ this.elements = elements; this.maximumDifference = Integer.MIN_VALUE; }