title: Finding location of character in input2 from input1
body: <p><strong>Important note:</strong> <em>string (C++ object)</em> and any other library such as <em>array</em> or <em>vectors</em> that could store unlimited characters cannot be used. </p>
  
  <p>For my question:
  We are given <strong>input 1</strong>, which is a sentence of unlimited characters. eg. Life is Beautiful.</p>
  
  <p><strong>Input 2</strong>: character who's location we have to find using the reference point (the middle character in input 1 after it is sorted and repeating characters are deleted) taken as zero. eg. fee.</p>
  
  <pre><code>An example:
  Input 1: Life is beautiful
  Input 2: see
  
  Output: 2, -2, -2
  </code></pre>
  
  <p><strong>Explanation:</strong> So firstly, we remove any spaces from input 1 and make all lowercase, then sort it in ascending order after which we find the reference letter (For above example, it's 'i'). We remove the repeating characters and then finally, put positions to character in input 1.</p>
  
  <pre><code>Example 2
  Input 1: abcde
  Input 2: aad
  
  Output: -2, -2, 1
  </code></pre>
  
  <p>If the input 2 contains reference point, then the code returns zero.
  Eg.</p>
  
  <pre><code>An example:
  Input 1: abcde
  Input 2: cab
  
  Output: 0
  </code></pre>
  
  <p>The input1 is always odd and input2 is always 10 character max.</p>
  
  <p>The problem I have is that I am not sure how to store these inputs without using strings, array etc. And even if I know how to store them, I cannot compare the inputs like input1[1] = input2[1] because we cannot use arrays/strings.</p>
  
  <p><em>Is list an useful option with regards to important note?</em></p>
  
  <p>I have mostly done it with the use of array but not sure how to approach it without the array. I tried to loop a character but it only stores the first character.</p>
  
  <p>My practice code: </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
  
      char input1;
  
      for(int i =0; i &lt; 3; i++ ) //for chacking whether the loops work or not.
  
      {
          cin &gt;&gt; input1;
  
      }
  
      cout&lt;&lt; input1;
  
      char input2;
  
  }
  </code></pre>
  
  <p>Please add any relevant tags.
  I hope all the edits help. </p>