CODINGAME: FIX THE SPACES

Subscribers:
4,890
Published on ● Video Link: https://www.youtube.com/watch?v=J3UXgIMw-CE



Duration: 12:12
25 views
1


I need to fix the original sentence by adding spaces where they should be.

EXPLANATION CODE:
1) The program defines a function called solve which takes three parameters: a string representing the sentence to be deciphered, an array of possible words, and an array to store the current solution being tested. The function uses recursion to try out all possible combinations of words until it finds a solution that works. It stores all successful solutions in a global array called $solutions.

2) The main part of the program reads the input, populates the $words array with the list of possible words, and then calls the solve function to find all solutions. If there is only one solution, it prints that solution. If there are multiple solutions, it prints "Unsolvable".

#codingame #coding #game #programming #easy #difficulty #reading #arithmetic #php #learntocode #tutorial #education #problemsolving #algorithmic #asmr #asmrtyping #backtracking #string #manipulation #fix #the #spaces







Tags:
codingame
coding
game
programming
problem solving
problem
solving
algorithmic
reading
asmr
asmr typing
education
easy difficulty
easy
difficulty
tutorial
how to program
explanation
how to
php
fix the spaces
fix
the
spaces
backtracking
string manipulation
string
manipulation