Данный отчёт сгенерирован 10.02.2023 18:21:31 UTC.
HTML версия (этот сайт) сгенерирован 10.02.2023 18:21:38 UTC.
Коммит: [bfeb65b9] add automatic zip creation
10.02.2023 18:21:31
Задача: Рима 10.02.2023 18:21:31
Описание: Визначити функцію rhyme, яка отримує два слова, наприклад, «комар» та «кошмар». Якщо введені слова римуються, функція повертає 1, якщо не римуються, 0. Не заглиблюючись у віршування, вважатимемо, що слова римуються, якщо в них збігаються останні три літери або якщо одне зі слів є закінченням іншого. 10.02.2023 18:21:31
Решений: 92 10.02.2023 18:21:31
Рима 10.02.2023 18:21:31
 function rhyme(l ,r) {
    if (l.slice(-3) == r.slice(-3)) return 1;
    
    if (l.includes(r) || r.includes(l)) return 1;
    
    return 0;
}
 function rhyme(a, b) {
  let j = b.length - 1;
  for (let i = a.length - 1; i > a.length - 4; i--) {
    if (i === -1) return 1;
    if (a[i] != b[j]) return 0;
    j--;
    if (j === -1) return 1;
  }
  return 1;
}
 function rhyme(word1, word2)
{
    let f = word1.length;
    let f1 = word2.length;
    if(word1.indexOf(word2, f - f1) !== -1 || word2.indexOf(word1, f1 - f) !== -1)
    return 1;
    if(word1.slice(f-3, f) == word2.slice(f1-3, f1))
        return 1;
      else
        return 0;
}
 function rhyme(a, b) {
    return (a.slice(-3) === b.slice(-3) || a.indexOf(b) != -1 || b.indexOf(a) != -1) ? 1 : 0;
}
 function rhyme(a, b) {
    let drey = 0;
    let pry = a.slice(a.length - b.length);
    let drop = a.slice(a.length - 3);
    let fal = b.slice(b.length - 3);
    if(drop == fal || pry == b){
        drey = 1;
    }
        return drey;
}
 function rhyme(a, b) {
    return (a.slice(-3) === b.slice(-3) || a.indexOf(b) != -1 || b.indexOf(a) != -1) ? 1 : 0;
}
 function rhyme(firstWord, secondWord) {
    if(firstWord.indexOf(secondWord.slice(-3, secondWord.length)) != -1 || secondWord.indexOf(firstWord.slice(-3, firstWord.length)) != -1)
    return 1;
    return 0;
}
 function rhyme(word1,word2){
    let last3CharsOfWord1 = `${word1.charAt(word1.length-3)}${word1.charAt(word1.length-2)}${word1.charAt(word1.length-1)}`
    let last3CharsOfWord2 = `${word2.charAt(word2.length-3)}${word2.charAt(word2.length-2)}${word2.charAt(word2.length-1)}`
    if (last3CharsOfWord1 == last3CharsOfWord2 || word1.endsWith(word2) || word2.endsWith(word1))  return 1
    else return 0


}
 function rhyme(a, b) {
    if (a.indexOf(b) != -1 || a.slice(a.length - 3) == b.slice(b.length - 3)) return 1;
    return 0;
}
 function rhyme(a, b)
{
if (a == b.slice(b.length-2, b.length))
{
return 1;
}
if (b == a.slice(a.length-2, a.length))
{
return 1;
}
let first = a.slice(a.length-3, a.length);
let second = b.slice(b.length-3, b.length);
if (first == second)
{
return 1;
}
else 
{
return 0;
}
}
 function rhyme(a, b) {
    const c = a.length;
    const d = b.length;
    return a.substr(c - 3, c) === b.substr(d - 3, b) || rhyme2(a, b) || rhyme2 (b, a) ? 1 : 0;
    }
    
    function rhyme2(a, b) {
        return b.substr(b.length - a.length, b.length) === a;
    }
 function rhyme(s1, s2) {
    let i = 0;
    while (i < 3 && i < s1.length && i < s2.length) {
        if (s1[s1.length - 1 - i] != s2[s2.length - 1 - i]) return 0;
        else i++;
    }
    return 1; 
}
 function rhyme ( a, b ) {
    let res = 0;
    if ( a.slice (-3) == b.slice (-3) || a.endsWith ( b ) || b.endsWith ( a ) ) 
    res = 1;
    else
    res = 0;
    return res;
}
 function rhyme(a, b) {
    const lenA = a.length;
    const lenB = b.length;
    return a.substr(lenA - 3, lenA) === b.substr(lenB - 3, lenB) || isTail(a, b) || isTail(b, a) ? 1 : 0;
}

function isTail(a, b) {
    return b.substr(b.length - a.length, b.length) === a;
}
 function rhyme(a, b)
{
if(a.slice(-3) == b.slice(-3)||a.indexOf(b) >= 0 || b.indexOf(a) >= 0) 
 return 1
 return 0
}
 function rhyme(a, b)
{
if(a.slice(-3) == b.slice(-3)||a.indexOf(b) >= 0 || b.indexOf(a) >= 0) 
 return 1
    else return 0
}
 function rhyme(word1, word2) {
    if(word2.length< 3 && word1.lastIndexOf(word2) == word1.length-word2.length){
        return 1;
    }
    if(word1.length< 3 && word2.lastIndexOf(word1) == word2.length-word1.length){
        return 1;
    }
    if(word1.substring(word1.length-3, word1.length)==word2.substring(word2.length-3, word2.length)){
            return 1;
    }  
    return 0; 
    
}
 function last(a, b) {
        if (a.length >= b.length) if (a.length - b.length == a.lastIndexOf(b)) return "okk";
        if (b.length >= a.length) if (b.length - a.length == b.lastIndexOf(a)) return "okk";
    }
    function rhyme(s, ss) {
        if (last(s, ss) == "okk") return 1
        if (s[s.length - 1] == ss[ss.length - 1] && s[s.length - 2] == ss[ss.length - 2] && s[s.length - 3] == ss[ss.length - 3]) return 1
        else return 0
    }
 function rhyme(word1, word2) {
  let word1End = word1.substring(word1.length - 3);
  let word2End = word2.substring(word2.length - 3);
  if (word1End === word2End || word1.endsWith(word2) || word2.endsWith(word1)) {
    return 1;
  } else {
    return 0;
  }
}
 function rhyme(a,b){
    if (a.endsWith(b) == true || b.endsWith(a) == true || a.slice(-3) == b.slice(-3)) return 1;
    else return 0;
}
 function rhyme(word1, word2) {
  let sub1 = word1.slice(-3);
  let sub2 = word2.slice(-3);
  if (sub1 === sub2 || word1.endsWith(word2) || word2.endsWith(word1)) {
    return 1;
  }
  return 0;
}
 function rhyme(a, b) {
    return (a.slice(-3) === b.slice(-3) || a.indexOf(b) != -1 || b.indexOf(a) != -1) ? 1 : 0;
}
 function rhyme(a, b) {
    return (a.slice(-3) === b.slice(-3) || a.indexOf(b) != -1 || b.indexOf(a) != -1) ? 1 : 0;
}
 function rhyme(str1,str2) {
    if ((str1.length>=3) && (str2.length>=3)) {if (str1.slice(-3)==str2.slice(-3)) {return 1} else {return 0}}
    if ((str1.length< 3) && (str2.length>=3)) {if (str1==str2.slice(-str1.length)) {return 1} else {return 0}}
    if ((str1.length>=3) && (str2.length< 3)) {if (str1.slice(-str2.length)==str2) {return 1} else {return 0}}
    if ((str1.length< 3) && (str2.length< 3)) {if (str2.slice(-str1.length)==str1.slice(-str2.legnth)) {return 1} else {return 0}}
}
 function rhyme(a, b){
    let k=0
    if(a.length< 3 || b.length< 3){
        if(a.length>=b.length){
            for(i=0;i< b.length;i++){
                if(a[a.length-1-i]==b[b.length-1-i]){
                    k++
                }
            }
            if(k==b.length){
                return 1
            }
        }
        else{
            for(i=0;i< a.length;i++){
                if(a[a.length-1-i]==b[b.length-1-i]){
                    k++
                }
            }
            if(k==a.length){
                return 1
            }
        }
    }
    for(i=0;i< 3;i++){
        if(a[a.length-1-i]==b[b.length-1-i]){
            k++
        }
    }
    if(k>=3){
        return 1
    }
    return 0
}
 function rhyme(str1, str2) {
    let reversedStr1 = str1.split("").reverse().join("");
    let reversedStr2 = str2.split("").reverse().join("");

    return (str1.slice(str1.length - 3) === str2.slice(str2.length - 3)) || 
           (reversedStr1.indexOf(reversedStr2) === 0) ||
           (reversedStr2.indexOf(reversedStr1) === 0) 
           ? 1 
           
           : 0;
}
 function rhyme(s1, s2){
    function rever(s){
        return s.split("").reverse().join("");
    }
    s1=rever(s1);
    s2=rever(s2);
    let counter=0;
    for(let i=0; i< s1.length && i< s2.length; i++){
        if(s1[i]==s2[i]){
            counter++;
        }
        else{
            break
        }
    }
    if(counter>=3){
        return 1;
    }
    if (s1.length< 3 || s2.length< 3){
        if(s1.length< 2 || s2.length< 2){
            if (s1[0]==s2[0])
                return 1;
        }
        else{
            for(let i=0; i< 2; i++){
                if(s1[i]!=s2[i])
                    return 0;
            }
            return 1;
        }
    }
    return 0;
}
 function rhyme(a, b) {
    let count = 0;
    for (let i = 1; i <= 3; i++) {
        if (a.charCodeAt(a.length - i) == b.charCodeAt(b.length - i)) count++;
    }
    return (count == 3 || a.indexOf(b) != -1 || b.indexOf(a) != -1) ? 1 : 0;
}
function rhyme(a, b) {
    if(a == b.slice(b.length-2, b.length))
        return 1;
    if(b == a.slice(a.length-2, a.length))
        return 1;
    
    return (a.slice(a.length-3, a.length) == b.slice(b.length-3, b.length)) ? 1 : 0;
}
 function rhyme(str1, str2) { 
 
if(str1.indexOf(str2) >= 0 || str2.indexOf(str1) >= 0) 
return 1; 
if(str1.slice(str1.length-3,str1.length)==str2.slice(str2.length-3,str2.length)) 
return 1; 
else 
return 0; 
}
 function rhyme(a, b) {
    let a1 = a.slice(-3);
    let b1 = b.slice(-3);
    
    if(a1==b1 || a.includes(b) || b.includes(a))
        return 1;
    else 
        return 0;
    
}
 function rhyme(first,second){
    let fy = first.slice(first.length - 3)
    let sy = second.slice(second.length - 3)
    let c = false
    if(first.length >= second.length){
        if(first.slice(first.length - second.length) == second){
            c = true
        }
    }else{
        if(second.slice(second.length - first.length) == first){
            c = true
        }
    }
    if(fy == sy || c){
        return 1
    }else{
        return 0
    }
    
}
 function rhyme(a, b) {
    const lenA = a.length;
    const lenB = b.length;
    return a.substr(lenA - 3, lenA) === b.substr(lenB - 3, lenB) || isTail(a, b) || isTail(b, a) ? 1 : 0;
}

function isTail(a, b) {
    return b.substr(b.length - a.length, b.length) === a;
}
 function rhyme(a, b)
{
    let array1 = a.split('').reverse().join('');
    let array2 = b.split('').reverse().join('');

    let lastletters1 = array1.slice(0, 3);
    let lastletters2 = array2.slice(0, 3);

    if (lastletters1 == lastletters2 || a.endsWith(b) || b.endsWith(a))
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
 function rhyme(a, b) {
    const lenA = a.length;
    const lenB = b.length;
    return a.substr(lenA - 3, lenA) === b.substr(lenB - 3, lenB) || isTail(a, b) || isTail(b, a) ? 1 : 0;
}

function isTail(a, b) {
    return b.substr(b.length - a.length, b.length) === a;
    }
 function rhyme(zx, xc){
    return +((zx.substring(zx.length-3) == xc.substring(xc.length-3)) || (zx == xc.substring(xc.length-zx.length)) || (xc == zx.substring(zx.length-xc.length)));
    
}
 function rhyme(string1, string2){
    let a = string1.slice(string1.length - 3, string1.length)
    let b = string2.slice(string2.length - 3, string2.length)
    let c = string1.slice(string1.length - string2.length, string1.length)
    let d = string2.slice(string2.length - string1.length, string2.length)
    if (a == b)
        return 1
    else if (string1 == d || string2 == c)
        return 1
    else
        return 0
}
 function last(a, b) {
        if (a.length >= b.length) if (a.length - b.length == a.lastIndexOf(b)) return "okk";
        if (b.length >= a.length) if (b.length - a.length == b.lastIndexOf(a)) return "okk";
    }
    function rhyme(s, ss) {
        if (last(s, ss) == "okk") return 1
        if (s[s.length - 1] == ss[ss.length - 1] && s[s.length - 2] == ss[ss.length - 2] && s[s.length - 3] == ss[ss.length - 3]) return 1
        else return 0
    }
 function rhyme(a, b) {
    if((a.includes(b) && a[a.length - 1] == b[b.length - 1]) || (b.includes(a) && a[a.length - 1] == b[b.length - 1]))
    return 1;
let c=a.slice(a.length-3, a.length);
let d=b.slice(b.length-3, b.length);
for(let i=0;i<3; i++){
if(c[i]!=d[i])
return 0;
}
return 1;
}
 function rhyme(str1, str2) {
    if (str1.slice(str1.length-3,str1.length) === str2.slice(str2.length-3,str2.length)) {
        return 1 ;
    } else if (str1.slice(str1.length - str2.length) == str2 || str2.slice(str2.length - str1.length) == str1) {
        return 1;
    } else {
        return 0 ;
    }
}
 function rhyme(a,b){
    if(a.includes(b)||b.includes(a)){return 1;}
    let m = a.split('').reverse();
    let n = b.split('').reverse();
    for(let i = 0;i< 3;i++){
        if(m[i]!=n[i]){return 0;}
    }
    return 1;
}
 function rhyme(word1,word2){
    let last3CharsOfWord1 = `${word1.charAt(word1.length-3)}${word1.charAt(word1.length-2)}${word1.charAt(word1.length-1)}`
    let last3CharsOfWord2 = `${word2.charAt(word2.length-3)}${word2.charAt(word2.length-2)}${word2.charAt(word2.length-1)}`
    if (last3CharsOfWord1 == last3CharsOfWord2 || word1.endsWith(word2) || word2.endsWith(word1))  return 1
    else return 0


}
 function last(a, b) {
        if (a.length >= b.length) if (a.length - b.length == a.lastIndexOf(b)) return "okk";
        if (b.length >= a.length) if (b.length - a.length == b.lastIndexOf(a)) return "okk";
    }
    function rhyme(s, ss) {
        if (last(s, ss) == "okk") return 1
        if (s[s.length - 1] == ss[ss.length - 1] && s[s.length - 2] == ss[ss.length - 2] && s[s.length - 3] == ss[ss.length - 3]) return 1
        else return 0
    }
 function rhyme(s1, s2)
{
    s1 = rever(s1);
    s2 = rever(s2);

    var counter = 0;

    for(var i = 0; i < s1.length && i < s2.length; i++)
    {
        if(s1[i] == s2[i])
            counter++;

        if(counter >= 3)
            return 1;
    }

    if(s1.length < 3 || s2.length < 3)
    {
        if(s1.length < 2 || s2.length < 2)
        {
            if (s1[0] == s2[0])
                return 1;
        }
        else
        {
            for(var i = 0; i < 2; i++)
            {
                if(s1[i] != s2[i])
                    return 0;
            }
            return 1;
        }
    }

    return 0;
}

function rever(str)
{
    arr = str.split('');
    arr.reverse();
    str = arr.join('');

    return str;
}
 function rhyme(a, b) {
    let a1 = a.split('').reverse().join('');
    let b1 = b.split('').reverse().join('');
    if (a1.slice(0, 3) == b1.slice(0, 3) || a.endsWith(b) || b.endsWith(a)) {
      return 1;
    } 
    else {
        return 0;
    }
}
 function rhyme ( a, b ) {
    let res = 0;
    if ( a.slice (-3) == b.slice (-3) || a.endsWith ( b ) || b.endsWith ( a ) ) 
    res = 1;
    else
    res = 0;
    return res;
}
 function rhyme(string1, string2){
    if(string1.endsWith(string2)
        || string2.endsWith(string1)
        || string1.slice(string1.length - 3, string1.length) == string2.slice(string2.length - 3, string2.length)){
        return 1;
    }else{
        return 0;
    }
}
 function rhyme(r1, r2) {
    r1 = r1.slice(-3);
    r2 = r2.slice(-3);
    if (r1.length > r2.length) {
        if (r1.indexOf(r2) != -1) return 1;
        else return 0;
    }
    else {
        if (r2.indexOf(r1) != -1) return 1;
        else return 0;
    }
}
 function rhyme(a, b) {
    let k = Math.min(a.length, b.length, 3);
    let str1 = a.substring(a.length-k);
    let str2 = b.substring(b.length-k);
    return str1 == str2 ? 1:0;
}
 function rhyme(a, b) {
    if((a.includes(b) && a[a.length - 1] == b[b.length - 1]) || (b.includes(a) && a[a.length - 1] == b[b.length - 1]))
        return 1;
        
    a = a.slice(-3);
    b = b.slice(-3);
    if (a == b)
        return 1;

    else
        return 0;
}
 function rhyme(word1,word2){
    if (word1.slice(word1.length-3,word1.length) == word2.slice(word2.length-3,word2.length)){
        return 1;
    }
    if (word2.indexOf(word1) >= 0) {
        return 1;
    }
    if (word1.indexOf(word2) >= 0) {
        return 1;
    }
    else {
        return 0;
    }
}
 function rhyme(str1, str2){
   
   if (str1.slice(-3) === str2.slice(-3)) return 1;
   if (str1.indexOf(str2) != -1) return 1;
   if (str2.indexOf(str1) != -1) return 1;
   
   return 0;

}
 function rhyme(a, b) {
    let A = a.slice((((a.length-1)+1)-3), ((a.length-1)+1))
    let B = b.slice((((b.length-1)+1)-3), ((b.length-1)+1))
    let C = a.slice((((a.length-1)+1)-b.length), ((a.length-1)+1))

    if (A==B || b==C){
        return 1
    }
return 0
}
 function rhyme(a, b){ 
    let result = 0; 
    if(a.slice(-3) == b.slice(-3) || a.endsWith(b) || b.endsWith(a)) { 
        result = 1; 
    } 
     else { 
         result = 0; 
     }    
    return result;
    }
 function rhyme(a, b) {
    a.split('');
    b.split('');
    if(a[a.length - 1] == b[b.length - 1] && a[a.length - 2] == b[b.length - 2] && a[a.length - 3] == b[b.length - 3]){
        return 1;
    }else if(a[a.length - b.length] == b[0]){
        return 1;
    }else if (b[b.length - a.length] == a[0]){
        return 1;
    }else{
        return 0;
    }
}
 function rhyme(a, b)
{
if(a.slice(-3) == b.slice(-3))
return 1;
if(a.endsWith(b) || b.endsWith(a))
return 1;
return 0;
}
 function rhyme(a,b){
    if((a.slice(a.length-3,a.length) == b.slice(b.length-3,b.length)) || (a.indexOf(b)!=-1) || (b.indexOf(a)!=-1)){
        return 1
    }else{
        return 0
    }
}
 function rhyme(str1,str2){
    let last1 = str1.slice(-3);
      let last2 = str2.slice(-3);
      if(last1 === last2 ){
          return 1;
      }
      if (str1[0] == str2[str2.length-1]){
          return 1;
      }
      else{
          return 0;
      }
}
 function rhyme(a, b)
{
    let res;
    a = a.slice(-3);
    b = b.slice(-3);
    if(a.length < b.length)
        res = b.indexOf(a);
    else
        res = a.indexOf(b);
    if(res == -1)
        return 0;
    return 1;
}
 function rhyme(a, b) {
  let n1 = a.slice(-3)
  let n2 = b.slice(-3)
  if (a.includes(n2)) return 1
  if (b.includes(n1)) return 1
  return 0
}
 function rhyme(a,b){
    let l = a.split("")
    let k = b.split("")
    var f = 0
    if (l[a.length-1] == k[b.length-1] && l[a.length-2] == k[b.length-2] && l[a.length-3] == k[b.length-3]){
        f = 1
    } 
    let j = a.lastIndexOf(b)
    let r = b.lastIndexOf(a)
    if (j > 0 || r > 0 ){
        f = 1
    }
    
    return f
}
 function rhyme(a, b) {
    if(a.substr(a.length-3,a.length) == b.substr(b.length-3,b.length)  || a ==  b.substr(b.length-a.length, b.length)  || b ==  a.substr(a.length-b.length, a.length) ){
        return 1;
    }else {return 0}
    
}
 function rhyme(a, b){
    let str1 = a.slice(-3);
    let str2 = b.slice(-3);

    if (str1 == str2 || a.includes(b) || b.includes(a)){
        return 1;
    } else if (str1 != str2){
        return 0;
    }
}
 function rhyme(a, b) {
    if(a.lastIndexOf(b.slice(b.length-3))==a.length-3 || a.lastIndexOf(b)==a.length-b.length && a.length-b.length != -1 || b.lastIndexOf(a)==b.length-a.length && b.length-a.length != -1) return (1);
    else return (0);
}
 function rhyme(a, b) {
    const lenA = a.length;
    const lenB = b.length;
    return a.substr(lenA - 3, lenA) === b.substr(lenB - 3, lenB) || isTail(a, b) || isTail(b, a) ? 1 : 0;
}

function isTail(a, b) {
    return b.substr(b.length - a.length, b.length) === a;
}
 function rhyme(s1,s2){
    return (s1.slice(-3) == s2.slice(-3)) ? 1:
        (s1.lastIndexOf(s2) != -1 || s2.lastIndexOf(s1) != -1)? 1:
        0
}
 function rhyme(a, b) {
    const lenA = a.length;
    const lenB = b.length;
    return a.substr(lenA - 3, lenA) === b.substr(lenB - 3, lenB) || isTail(a, b) || isTail(b, a) ? 1 : 0;
}

function isTail(a, b) {
    return b.substr(b.length - a.length, b.length) === a;
}
 function rhyme(word1, word2){
    let splice = word1.slice(word1.length - 3);
    let splice1 = word2.slice(word2.length - 3);
    let splice3 = word1.slice(word1.length - word2.length);
    let splice4 = word2.slice(word2.length - word1.length);
    if (splice == splice1){
        return 1
    }
    else if (splice3 == word2){
        return 1;
    }
    else if (splice4 == word1){
        return 1
    }
    else{
        return 0
    }
}
 function rhyme(a,b){
    let str1 = a.slice(-3)
    let str2 = b.slice(-3)
    if (str1==str2 || a.includes(b) || b.includes(a)){
        return 1
    }
    else{
        return 0 
    }
}
 function rhyme(a, b) {
        let res = 0
        if (a.slice(a.length - 3, a.length) == b.slice(b.length - 3, b.length)) {
            res = 1
        }
        else if (a==b.slice(b.length - a.length, b.length))
        {
            res = 1;
        }        
        else if (b==a.slice(a.length - b.length, a.length))
        {
            res = 1;
        }
        return res;
    }
 function rhyme(word1, word2)
{
    let w1 = word1.slice(-3)
    let w2 = word2.slice(-3)
    if(word1.includes(w2)) 
    {
        return 1
    }
    if(word2.includes(w1)) 
    {
        return 1
    }
    if(word1.includes(word2)) 
    {
        return 1
    }
    if(word2.includes(word1)) 
    {
        return 1
    }
    return 0
}
 function rhyme(a, b)
{
    let s1 = a.slice(-3);
    let s2 = b.slice(-3);
    if (s1 == s2 || (a.includes(b) || b.includes(a))) return 1;
    else return 0;
}
 function rhyme(a, b) {
    const lenA = a.length;
    const lenB = b.length;
    return a.substr(lenA - 3, lenA) === b.substr(lenB - 3, lenB) || isTail(a, b) || isTail(b, a) ? 1 : 0;
}

function isTail(a, b) {
    return b.substr(b.length - a.length, b.length) === a;
}
 function rhyme(a, b){
    if(a.length < 3){
        b = b.slice(-a.length, b.length);
        if(a == b){
            return 1;
        }
    }
    if(b.length < 3){
        a = a.slice(-b.length, a.length);
        if(a == b){
            return 1;
        }
    }
    a = a.slice(-3, a.length);
    b = b.slice(-3, b.length);
    for(let i = 0; i != 3; i++){
        if(a == b){
            return 1;
        }
        else return 0;
    } 
}
 function rhyme(a, b){
    let res;
    a = a.slice(-3);
    b = b.slice(-3);
    if(a.length < b.length)
        res = b.indexOf(a);
    else
        res = a.indexOf(b);
    if(res == -1)
        return 0;
    return 1;
}
 function rhyme(str1, str2){
    let identical = false
    if(str1.length > 3 && str2.length > 3){
        if(str1.slice(-3) == str2.slice(-3)){
            identical = true
        }
        else{
            identical = false
        }
    }
    else{
        if(str1.slice(-str2.length) == str2 || str2.slice(-str1.length) == str1){
            identical = true
        }
        else{
            identical = false
        }
    }
    if(identical) return 1
    else return 0

}
 function rhyme(a, b) {
    if ( a[a.length - 1 ] == b[b.length - 1 ] && a[a.length - 2 ] == b[b.length - 2 ] && a[a.length - 3 ] == b[b.length - 3 ]){
        return 1
    }
    if ( a.includes(b, a.length - b.length)){
        return 1
    }
    if ( b.includes(a, b.length - a.length)){
        return 1
    }
    else{
        return 0
    }
}
 function rhyme(a, b){
    let d_var;
    if(a.toLowerCase()[a.length-1] == a.toLowerCase()[0] || a.slice(a.length-3, a.length) == b.slice(b.length-3, b.length) || a.toLowerCase()[0] == b.toLowerCase()[b.length-1]){
        d_var = 1;
    }else{
        d_var = 0;
    };
    return d_var;
}
 function rhyme(a,b){
    let s1,s2 
    if(a.length< b.length){
        s1=a
        s2=b
    }else{
        s1=b
        s2=a  
    } 
    if(a.split('').reverse().join('').slice(0,3)==b.split('').reverse().join('').slice(0,3)||s2.slice(s2.length-s1.length)==s1){
        return 1
    } 
    return 0
}
 function rhyme(w1, w2) {
    if ((w1.slice(-3) == w2.slice(-3)) || (w1 == w2.slice(w2.length-w1.length)) || (w2 == w1.slice(w1.length-w2.length)))
    return 1
    else
    return 0
}
 function rhyme(word, word2)
{
    
    if(word.slice(word.length-3)==word2.slice(word2.length-3)||word.slice(word.length - word2.length)==word2||word2.slice(word2.length - word.length)==word) return 1;
    else return 0;
}
 function rhyme(a, b) {
let first = a.substring(a.length-3, a.length);
let second = b.substring(b.length-3, b.length);
let count = 0;
if(first == second){
 count = 1
}else{
   count = 0
}

for (let i = 0; i < b.length; i++) {
    let strB = b.substring(i,b.length);
    if(a == strB){
count = 1
break;
    }
}
for (let i = 0; i < a.length; i++) {
    let strA = a.substring(i,a.length);
    if(b == strA){
count = 1;
break;
    }
    
}
return count
}
 function rhyme(m,n){
    let result = 0;
    if(((m.slice(-3)) == (n.slice(-3))) || (m.endsWith(n)) || (n.endsWith(m))){
        result = 1;
    }
     else {
         result = 0;
     }   
    
    return result
}
 function rhyme(a, b){
    let str1 = a.slice(-3);
    let str2 = b.slice(-3);

    if (str1 == str2){
        return 1;
    }
    if (a.includes(b)){
        return 1;
        }
    if (b.includes(a)){
        return 1;
        }
    else {
        return 0;
    }
    }
 function rhyme(a, b) {
    if(a.indexOf(b) != -1){
        return 1;
    }else if(b.indexOf(a) != -1){
        return 1;
    }else if(a.slice(a.length-3, a.length) == b.slice(b.length-3, b.length)){
        return 1;
    }else {
        return 0;
    }
}
 const rhyme = (word1, word2) => word1.slice(-3) === word2.slice(-3) ||  word1.endsWith(word2) ||  word2.endsWith(word1) ? 1 : 0;
 function rhyme(a, b) {
    if(a.slice(-3) == b.slice(-3))
        return 1;
    if(a.endsWith(b) || b.endsWith(a))
        return 1;
    return 0;
}
 function rhyme(str, str1) {
  let value
  let cut = str.slice(str.length - 3, str.length)
  if (str1.endsWith(cut)) value = 1
  else if (str.endsWith(str1) || str1.endsWith(str)) value = 1
  else value = 0
  return value
}
 function rhyme(a, b) {
    if((a.includes(b) && a[a.length - 1] == b[b.length - 1]) || (b.includes(a) && a[a.length - 1] == b[b.length - 1]))
        return 1;
        
    a = a.slice(-3);
    b = b.slice(-3);
    if (a == b)
        return 1;

    else
        return 0;
}
 function rhyme(word1, word2){
    let shorter = word1;
    let longer = word2;
    if (shorter.length > word2.length){shorter = word2; longer = word1;}
    if (shorter.length < 3){
        if (shorter == longer.slice(0-shorter.length)) return 1;
        return 0;
    }
    if (word1.slice(-3) == word2.slice(-3)) return 1;
    return 0;
}
 function rhyme(s1, s2){
    for(let i = s1.length-1, j=s2.length-1; i>=Math.max(s1.length-3, 0) && j>=Math.max(s2.length-3, 0); i--, j--){
        console.log(s1[i]+"\n"+s2[j]+"\n");
        if(s1[i]!=s2[j]){
            
            return 0;
        }
    }
    return 1;
}

console.log(rhyme("sdfg", "fg"));
 function rhyme(a, b) {
    let a1 = a.slice(-3);
    let b1 = b.slice(-3);
    
    if(a1==b1 || a.includes(b) || b.includes(a))
        return 1;
    else 
        return 0;
    
}