you stack block form pyramid each block color represent single letter each row block contain block row beneath center topto pyramid aesthetically pleasing specific triangular pattern allow a triangular pattern consist single block stack block the pattern give list threeletter string allow character pattern represent leave right block respectively character blockfor example ABC represent triangular pattern C block stack a left b right block note different BAC B leave a right bottomyou start row block give single string use base pyramidgiven allow return true build pyramid way triangular pattern pyramid allow false Example 1input BCD allow BCCCDECEAFFFOutput trueexplanation the allow triangular pattern show rightstarte level 3 build CE level 2 build a level 1there triangular pattern pyramid BCC CDE CEA all allowedexample 2input AAAA allow AABAACBCDBBEDEFOutput falseexplanation the allow triangular pattern show rightstarte level 4 multiple way build level 3 try possibilite stuck building level 1 constraints2 bottomlength 60 allowedlength 216allowedilength 3the letter input string set a b c d e fall value allow unique