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.
Like nl_x1 said, I'm not sure what this taught me about scoping.
classDifference{privateint[]elements;publicintmaximumDifference;// Add your code herepublicDifference(int[]arr){elements=arr;}publicvoidcomputeDifference(){Array.Sort(elements);maximumDifference=Math.Abs(elements[^1]-elements[0]);}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 14: Scope
You are viewing a single comment's thread. Return to all comments →
In C#
Like nl_x1 said, I'm not sure what this taught me about scoping.