title: Can we define two functions with same name but different parameters?
body: <p>I am confused when we need to define another function we can give it a different name. But on LeetCode discussion, I found a popular post in which there are two functions with same name, but having different parameters.</p>
  <pre><code>int longestPalindromeSubseq(string s) {
      return longestPalindromeSubseq(0,s.size()-1,s); 
  }
  int longestPalindromeSubseq(int l, int r, string &amp;s) {
      if(l==r) return 1;
      if(l&gt;r) return 0;  //happens after &quot;aa&quot; 
      return s[l]==s[r] ? 2 + longestPalindromeSubseq(l+1,r-1, s) : 
          max(longestPalindromeSubseq(l+1,r, s),longestPalindromeSubseq(l,r-1, s)); 
  }
  </code></pre>