delete some number and use class to solution

create the class function to calculate