Given a list of numbers, write a function that gives the largest interval, along with the size of it. Ex. 2, 4, 9, Left=4, Right=9 Interval=5

后端 未结 0 827
眼角桃花
眼角桃花 2021-01-01 08:56
IntervalFinder<-function(x) {
   sort(x)
   n=length(x)
   IntervalsList=c()
   for (i in x) {
   if (i <= n) {
   Int1= x[i]
   Int2= x[i+1]
   Interval= Int2         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题