+ 7
Challenge: Compare two words
Write a program (in any language that you like) that gets two words from user, and tells whether the words have the same letters and numbers of each letter. Comparison is not case-sensitive. Example : "apple" and "papel" both have one 'a', one 'e', one 'l' and two 'p', thus satisfying the given requirements. "teen" and "NEET" also satisfies. "sololearn" and "sololern" do not satisfy, bacause "sololearn" has one 'a' while "sololern" has no 'a'. "appeal" and "apparel" also does not satisfy.
21 Answers
+ 14
+ 5
here you go in PHP
https://code.sololearn.com/w3tlVO0YRSvu/#php
just edit the two words at the beginning of the code.
enjoy :)
p.s. here there is c++ version
https://code.sololearn.com/cgij8qZOXAkf/#cpp
+ 3
Here you go
https://code.sololearn.com/cvY45c8M29Sj/?ref=app
+ 2
My attempt in PHP: https://code.sololearn.com/wQdLaeFPb3lH/#
+ 2
My version:
https://code.sololearn.com/cVmptdYE3oXA/?ref=app
+ 1
https://code.sololearn.com/ciPO4Mbn3aFV/#py
+ 1
16 lines, written in 2 minutes.
https://code.sololearn.com/c0hx5pbM91fg/?ref=app
+ 1
sth like that
https://code.sololearn.com/cOL0rTa3qn2h/?ref=app
+ 1
Open my code, it's implemented.
0
this code copares words strings sentences anything......
input 2 strings seperated by enter
https://code.sololearn.com/cvBqbY6JFsEA/?ref=app
0
What do you mean with registers? (english is not my mother language)
0
@Timon PaBlick
oh, I thought that if won't work with words "teen" and "TEEN".
0
Mine too, I'll fix it.
0
Done.
0
@Timon PaBlick
will you show?
0
The statement in the 2 for loops is changed.
0
@Timon Pablick
yeah, fine.