• + 0 comments

    Help !!

    new to hackerRank , how to debug here ?? what's the expected input and output format ? This code runs perfect locally....

    import numpy as np from sklearn.linear_model import LinearRegression

    def return_cof(x,Y): x=np.array(x).reshape(-1, 1) y = np.array(Y).reshape(-1, 1) reg=LinearRegression().fit(x,Y) ans=reg.coef_ return round(ans[0],3)

    a=[15,12,8,8,7,7,7,6,5,3] b=[10,25,17,11,13,17,20,13,9,15] ans=return_cof(a,b) print(ans)