reymesson1 / Programacion-Web-Avanzada

1 stars 0 forks source link

Algorithm #29

Open reymesson1 opened 4 years ago

reymesson1 commented 4 years ago

description = this.state.orderAPI[0].description

        for(var i=0;i<description.length;i++){

            for(var j=0;j<ABC.length;j++){

                if(description[i]==ABC[j]){

                    str+=ABC[j]                      
                    count++                        
                }
            }

            if(count==4){
                break;
            }

        }

        count = 0

        for(var i=0;i<description.length;i++){

            for(var j=0;j<num.length;j++){

                if(description[i]==num[j]){

                    str+=num[j]
                    count++                        

                }
            }

            if(count==7){
                break;
            }

        }

        console.log(str)
reymesson1 commented 4 years ago

let sum = 0;

    let description = ""

    let ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

    let num = "0123456789"

    let count = 0;

    let str = ""