class Solution {
fun solution(a: Int, b: Int): Long {
if(a==b) return a.toLong()
var aLong:Long = a.toLong()
var bLong:Long = b.toLong()
if(a>b){
aLong = b.toLong()
bLong = a.toLong()
}
//n~m까지의 합 : (n부터 m까지의 갯수) * (n+m) / 2
return (bLong-aLong+1)*(bLong+aLong)/2
}
}