Please complete the coding exercises in this repo, upload code to a personal git repo, and share the link with us.
Please don't fork this repo. Download/Clone the repository, finish the exercise and upload it as a new repository in your github account. Share with us the link for that repository
To build and run the sample code please make sure you have the following prerequisites
- JDK 8+
- Maven
- Any IDE of your choice
This repository contains two tasks, each one is in a separate class.
Please implement the methods inside the classes according to the requirements specified in JavaDocs and make sure that all unit tests are green.
The task is located in cz/acamar/tasks/Task1.java
Given a string s consisting of some words separated by some number of spaces,
return the length of the last word in the string.
A word is a maximal substring consisting of non-space characters only.
Example input: "Hello World"
Expected output: 5
The task is located in cz/acamar/tasks/Task2.java
Given an integer array sorted in non-decreasing order,
return an array of the squares of each number sorted in non-decreasing order.
Example input: [-4,-1,0,3,10]
Expected output: [0,1,9,16,100]
Explanation: After squaring, the array becomes [16,1,0,9,100].
After sorting, it becomes [0,1,9,16,100].
Please upload completed code to a personal git repository and share the link to your repository with us.