I am not sure it was. Only struggling you learn, if you don’t struggle you don’t learn-
eventually you will have to be able to do the challenge on your own
I suggest you return here in three days and try again to solve this challenge on your own.
this is one possible implementation from the steps I wrote above, you can look at what happens with pythontutor.
function confirmEnding(str, target) {
let strLength = str.length;
let targetLength = target.length;
let indexToStart = strLength - targetLength;
let endOfString = str.slice(indexToStart);
let isItEqual = target === endOfString;
return isItEqual;
}
confirmEnding("Bastian", "n");
also, please, when you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
Please use the “preformatted text” tool in the editor (</>) to add backticks around text.
Yes, is true.
I dont feel good about it either I was very frustrated.
I will follow the steps you wrote above and do them on my own in three days on python tutor. I shall talk with you in three days time so Sunday.
I will follow the steps you wrote above with my own code.
How long did it take you to solve challenges on your own? I feel sad now so would be good to know if after 2 months is normal to struggle or dont remember which methods could help and how to apply them.
Thank you for mentoring me, it means a lot.
Karem
coding is hard, it is a completely new language that you have never heard before, with completely new syntax, new vocabulary, new rules.
And also, you are applying a seldom used skill: problem solving
To train both at the same time is really difficult, so you can try to train your problem solving skills taking algorithms and solving them this way as first thing:
just instructions in plain english (even the example above could contain too much code-slang), like a recipe, to go from the given input to the desired output
instead for the coding part, return to previous lessons, previous challenges, and try to do them again, even in different ways
example, here you have used
is there a different method that can do the same thing?
or, your return statements are return true and return false, can you instead reduce the code by returning an expression that evaluates to a boolean?