Good Code tests | Sololearn: Learn to code for FREE!

+1

Good Code tests

I have some issues in my code My code looks good , but could'nt pass the 4th and 5th tests https://www.sololearn.com/coach/63?ref=app Edit: this is my code via PlayGround https://code.sololearn.com/cHc08oNT1r8l/?ref=app

4/10/2021 3:30:47 PM

Younes M'rabti

11 Answers

New Answer

0

https://www.sololearn.com/coach/63?ref=app If you are talking about this problem then .... The inputs are dynamic for different problems, but they are giving the first input as the size of list (how many numbers they are gonna give). Read the problem statement carefully

+4

You must be using a phone to enter your code. I am guessing this because it has automatically placed spaces after all of the full-stops in your code when calling methods e.g. Scanner scan = new Scanner (System .in); should read Scanner scan = new Scanner (System.in); inp = scan. nextLine (); should read inp = scan.nextLine(); The same thing applies to everywhere else there are additional spaces. Phone keyboards are intended to assist people writing standard text. They have a habit of messing up code on a regular basis.

+2

Is there another way than mobile to sole coach codes I hate typing in mobile Martin Taylor

+2

Nope, as I understand it the Code Coach things are only available in the mobile app. I personally use a laptop and browser so have no access to the code coach lessons. I've used a 10" tablet with an external keyboard in the past which is tolerable but I still prefer a nice big screen. I'm an old fossil and my eyes aren't up to squinting at a tiny phone screen.

+2

I need a CCTV sensor detector anyone 🎖🎖

+1

Arun Ruban SJ i need more clarification Inputs are dynamic, not fixed in number of inputs

+1

Solve the Code Coach tasks on a PC or laptop, and then copy the code to the mobile app via an iCloud service. Writing code on a mobile is a mess and drives you crazy.

0

https://code.sololearn.com/cHc08oNT1r8l/?ref=app This is the code

0

The first input is how many numbers they are gonna given in the test case. In your code you are adding the first number along with the others. And you can directly take the inputs as integers, don't have to convert from string to integer. Hint: Create an array with the size as the first input, then input the numbers into the array and add the even numbers.

0

Thanks Quantum I found another solution simple By using Android emulator on laptop/pc you can run sololearn app . There are huge number of emulators (Nox is very simple)