I am looking for a review on the following code which is for this question. I am looking for a general review of the code. I am specifically also looking for advice on how to make this code run more efficiently.#include<iostream>#include<stdlib.h>using namespace std;long int b[100001]={0},x,n,m,i;char num[100001];  int main() {         cin>>n>>m;        for(i=1;i<=n;i++)           cin>>num[i];     while(m--)    {         b[100001]={0};         cin>>x;         for(i=1;i<x;i++)            {              b[i]=b[i-1]+abs(num[x]-num[i]);            }          cout<<b[x-1]<<\n;    }   return 0;}
Chef and Digits
c++;programming challenge