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.
staticStringisSatisfiable(intc1,intc2,inth1,inth2){//checking the initial condition for atleast and atmost if((c1>=35)&&(c2>=35)&&(h1<=95)&&(h2<=95)){//checking the minimum temperature with max temperatureif(h1>=c1&&h2>=c2){//checking if atmost of 2nd temperature is less than atleast of 1st temperature . If so return "no"if(h2<c1){return"NO";}//checking if atmost of 1st temperature is less than atleast of 2nd temperature. If so return "no"elseif(h1<c2){return"NO";}//if it satisfies all the condition . return "yes"else{return"YES";}}//if it fails with min temperature comparison with max temp return "no"else{return"NO";}}//if it fails the basic condition return "no"elsereturn"NO";}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Hot and Cold
You are viewing a single comment's thread. Return to all comments →