Asked another way, if I showed you this masked code file, using only your human brain, is it possible to fix the indentation issues, even if you know it should be 2-space indentation?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x
x
xxxxxxxxxxxxxxxxxxxxxxxxxxx
I have my own ideas, but I don't want to bias the answer. The actual source code and language will be revealed after I get a good batch of answers. Feel free to post your fix as a code block below.
This test assumes the following:
Note: If it's possible with your human brain, it should also be possible with code, right?
Bonus Points (optional): How would you break-down the logic to tackle this problem?
EDIT: Here's the source code, from which these exes were created:
function greet(firstName, lastName) {
var firstName = prompt('What is your first name?');
var lastName = prompt('Last name?');
var fullName = firstName + ' ' + lastName;
for (var i = 0; i < 10; i++) {
console.log('Hello,', fullName + '!');
}
}
greet(firstName, lastName);
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x
x
xxxxxxxxxxxxxxxxxxxxxxxxxxx