Skip to content

Commit 93fafbf

Browse files
committed
QuestionsMarks
1 parent 92ef2fd commit 93fafbf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

QuestionsMarks.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function QuestionsMarks(str) {
2+
res = false;
3+
for(let i=0; i<str.length; i++){
4+
for(let j=i+1; j<str.length; j++){
5+
if(Number(str[i]) + Number(str[j])=== 10){
6+
res = true;
7+
if(str.slice(i,j).split("?").length -1 < 3){
8+
return false;
9+
}
10+
}
11+
}
12+
}
13+
return res;
14+
}
15+
16+
// keep this function call here
17+
QuestionsMarks(readline());

0 commit comments

Comments
 (0)