Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
bjorngi38718y@linux-colonel you are probly right. Just did it from memory. It's been a while since school, and java ☺️
-
donuts236728yI guess it would be a good solution for a stream where you don't know the actual size so you could argue the implementation of the array has count :)
-
donuts236728yLOL..... Seems you just gave away the answer to the first contest problem sort of.... Would be a very bad solution though...
https://hackerrank.com/challenges/... -
In Erlang they recommend you use exception handling when doing things like traversing a tree
That way you don't have to go back through the recursive call stack once you find the value you're looking for, you instead just jump right back up to the handler, saving a lot of potential time
Related Rants
-
sulemartin8714was at a hackathon, had to write an app that sent current location to emergency contact. hard coded the locati...
-
daarkfall5Like many others my favourote shameless hack is a cronjob to restart our app server at 2am, thus preventing ou...
-
bilange14First time poster here. Please be nice :) My biggest workaround is one that's being currently deployed to 40 ...
Did this on my first programming exam.
int index = 0
int value = 0
try {
while true {
value += array[index]
index++
}
} catch NullPointerException {
System.out.print("Sum: " + value)
}
The task was to add together all numbers in an array.
I somehow aced the exam, but got called in to teachers office this is not the way to use exceptions.
undefined
wk19