Skip to content

Commit

Permalink
code to check two strings are anagram
Browse files Browse the repository at this point in the history
write a code to check the string is anagram or not
Sample Input:
str 1: Triangle
str 2:Integral
sample output: yes they are anagram
  • Loading branch information
Arunkumar1712 authored Jan 4, 2024
1 parent 1986ad1 commit 524d51f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions anagram .js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let a ="triangle";
let b="integral";
var check=0;
for(var i=0;i<a.length;i++){
for(var j=0;j<b.length;j++){
if(a[i]===b[j]){
check++
}
}

}
//console.log(check)
if(check === b.length){
console.log("yes")
}else{
console.log("no")
}

0 comments on commit 524d51f

Please sign in to comment.