R solving hackerrank challenge

后端 未结 5 886
挽巷
挽巷 2020-12-31 18:55

I would like to solve the challenge. The language of my preference is R. I am not sure how to receive input. On hackerrank coding window it says that

\"# En         


        
5条回答
  •  孤独总比滥情好
    2020-12-31 19:15

    I faced the similar issue for reading input in R in hackerrank . Then to use readLines i used following :

    input<-file('stdin', 'r')
    x <- readLines(input, n=1)
    

    If u again want to read another data y use same approach :

    y <- readLines(input, n=1)
    

提交回复
热议问题