Why does my method return null when I set max to null ? It should be initialized within the conditional statement | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why does my method return null when I set max to null ? It should be initialized within the conditional statement

I'm trynna return the variable with the highest domain within a set of domains and set of variables https://code.sololearn.com/ca0322a2VI7S/?ref=app

28th Nov 2020, 12:33 AM
Adrien Linares
Adrien Linares - avatar
1 Answer
0
It's hard to say without seeing a working version of the code, and your actual test cases. For example if your set of vars has 0 or 1 element, then max is never properly initialized.
28th Nov 2020, 3:53 AM
Tibor Santa
Tibor Santa - avatar