Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,795 members, 7,820,792 topics. Date: Tuesday, 07 May 2024 at 09:44 PM

Can Some Explain This Hackerrank Question For Me please(pics) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Can Some Explain This Hackerrank Question For Me please(pics) (555 Views)

Solve The Fizz - Buzz Hackerrank Challenge In Both Java And Javascript / Can You Explain This My Hackerrank Solution For Me? Please(pics) / Pls Explain This For Me (2) (3) (4)

(1) (Reply) (Go Down)

Can Some Explain This Hackerrank Question For Me please(pics) by TastyFriedPussy: 2:57pm On Nov 06, 2022
I can't believe I couldn't solve this if else question.. The part that's confusing me the most is 1<=n<=9. Does it mean I'll be testing for if two conditions I.e if 1<=n and if n<=9

I just want someone to explain the whole questions for me step by step from the constraint, input format, the meaning of test cases and just generally most of the terms used here...

Even the place I have to write down my code has code already written there why would they do such a thing? Wouldn't that affect my own code or how is that of help to me.
Please I need help cry


@qtguru

1 Like

Re: Can Some Explain This Hackerrank Question For Me please(pics) by qtguru(m): 3:05pm On Nov 06, 2022
TastyFriedPussy:
I can't believe I couldn't solve this if else question.. The part that's confusing me the most is 1<=n<=9. Does it mean I'll be testing for if two conditions I.e if 1<=n and if n<=9

I just want someone to explain the whole questions for me step by step from the constraint, input format, the meaning of test cases and just generally most of the terms used here...

Even the place I have to write down my code has code already written there why would they do such a thing? Wouldn't that affect my own code or how is that of help to me.
Please I need help cry


@qtguru

Simply means the 1 is the minimum value and 9 max whatever input you specify can either be equal to 1 or greater than 1 and less than 9, but if it's greater than 9 then the other condition.

Discrete Maths is an important foundation, if you want to really understand how to tackle algo. All the best

2 Likes

Re: Can Some Explain This Hackerrank Question For Me please(pics) by Dangrace01: 3:57pm On Nov 06, 2022
qtguru:


Simply means the 1 is the minimum value and 9 max whatever input you specify can either be equal to 1 or greater than 1 and less than 9, but if it's greater than 9 then the other condition.

Discrete Maths is an important foundation, if you want to really understand how to tackle algo. All the best

Maths

Further maths

Discrete maths

God y
Re: Can Some Explain This Hackerrank Question For Me please(pics) by ZiiVentures: 4:45pm On Nov 06, 2022
qtguru:


Simply means the 1 is the minimum value and 9 max whatever input you specify can either be equal to 1 or greater than 1 and less than 9, but if it's greater than 9 then the other condition.

Discrete Maths is an important foundation, if you want to really understand how to tackle algo. All the best

Oga help him na. This very question doesn't require any discrete math at all and you know it.
Re: Can Some Explain This Hackerrank Question For Me please(pics) by ZiiVentures: 4:47pm On Nov 06, 2022
TastyFriedPussy:
I can't believe I couldn't solve this if else question.. The part that's confusing me the most is 1<=n<=9. Does it mean I'll be testing for if two conditions I.e if 1<=n and if n<=9

I just want someone to explain the whole questions for me step by step from the constraint, input format, the meaning of test cases and just generally most of the terms used here...

Even the place I have to write down my code has code already written there why would they do such a thing? Wouldn't that affect my own code or how is that of help to me.
Please I need help cry


@qtguru

This question is very simple. Just make use of switch case.
Re: Can Some Explain This Hackerrank Question For Me please(pics) by qtguru(m): 5:04pm On Nov 06, 2022
ZiiVentures:


Oga help him na. This very question doesn't require any discrete math at all and you know it.

Discrete Maths is important for Algorithms. Calm down and read properly before mentioning someone. I didn't say he needed DM for this question, I advised for him to pick it up along the journey of DSA.
Re: Can Some Explain This Hackerrank Question For Me please(pics) by Newusername(m): 5:31pm On Nov 06, 2022
Dangrace01:


Maths

Further maths

Discrete maths

God y

Lol.
Re: Can Some Explain This Hackerrank Question For Me please(pics) by TastyFriedPussy: 5:34pm On Nov 06, 2022
ZiiVentures:


Oga help him na. This very question doesn't require any discrete math at all and you know it.

Re: Can Some Explain This Hackerrank Question For Me please(pics) by islamics(m): 5:44pm On Nov 06, 2022
@ ZiiVentures
I think the question want op to sabi if...else more. Instead of trying switch, the op should understand how multiple if else work.

For 1≤n≤9
It means your n would be greater than or equals 1 and less than equals 9.
What qtguru is saying, is that, you would need basics of discrete maths to understand your constraints in DSA question.
Re: Can Some Explain This Hackerrank Question For Me please(pics) by RepoMan007: 5:45pm On Nov 06, 2022
With all the insult you insult people here OP.
That thing is easy to be honest. Just try harder.
Re: Can Some Explain This Hackerrank Question For Me please(pics) by qtguru(m): 5:51pm On Nov 06, 2022
I didn't read your full-text but read it now.

Test cases = to test your code with multiple cases to see how your solution handles different inputs.

The code is written so you can handle the logic to compare the number, which the variable n, all you are required to do is supply the logic for comparing the value if it satisfies those constraints 1 <= n <= 9

Input format means the code will supply the input that your code expects to compare

The codes already supplied simply removes space

so what is left for you to do is compare the n against the constraint.


Output Format states the output should be based on the condition in accordance to the constraint.

Hope this helps
Re: Can Some Explain This Hackerrank Question For Me please(pics) by qtguru(m): 5:52pm On Nov 06, 2022
islamics:
@ ZiiVentures
I think the question want op to sabi if...else more. Instead of trying switch, the op should understand how multiple if else work.

For 1≤n≤9
It means your n would be greater than or equals 1 and less than equals 9.
What qtguru is saying, is that, you would need basics of discrete maths to understand your constraints in DSA question.

Exactly maybe I didn't communicate that well
Re: Can Some Explain This Hackerrank Question For Me please(pics) by ZiiVentures: 6:11pm On Nov 06, 2022
qtguru:


Discrete Maths is important for Algorithms. Calm down and read properly before mentioning someone. I didn't say he needed DM for this question, I advised for him to pick it up along the journey of DSA.


Yeah bro. Discrete maths is important in DSA. However, the guy was asking for an explanation to this very problem. You could have directed him on what step to take and tell him why discrete math is important for his learning.

1 Like

Re: Can Some Explain This Hackerrank Question For Me please(pics) by ZiiVentures: 6:14pm On Nov 06, 2022
qtguru:
I didn't read your full-text but read it now.

Test cases = to test your code with multiple cases to see how your solution handles different inputs.

The code is written so you can handle the logic to compare the number, which the variable n, all you are required to do is supply the logic for comparing the value if it satisfies those constraints 1 <= n <= 9

Input format means the code will supply the input that your code expects to compare

The codes already supplied simply removes space

so what is left for you to do is compare the n against the constraint.


Output Format states the output should be based on the condition in accordance to the constraint.

Hope this helps

Exactly like what's expected. Kudos!

(1) (Reply)

Sport Prediction API / Need Someone Who Can Build A 5 Page Website / Good WHM (webhost Manager With Unlimited Disk Space)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 29
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.