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.
Developing an approach:
Question is to form lists that have values less than x,y,z respectively and their sum should be less than n.
first loop : i < x - first element of list
second loop : j < y - second element of list
third loop : k < z - third element
Steps: 1. write loops to satisfy above three conditions
2. Check condition i+j+k!=n
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
List Comprehensions
You are viewing a single comment's thread. Return to all comments →
Developing an approach: Question is to form lists that have values less than x,y,z respectively and their sum should be less than n. first loop : i < x - first element of list second loop : j < y - second element of list third loop : k < z - third element
Steps: 1. write loops to satisfy above three conditions 2. Check condition i+j+k!=n