<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Memory Limit Exceeded-Need Help in Data Movement &amp; Streaming</title>
    <link>https://community.qlik.com/t5/Data-Movement-Streaming/Memory-Limit-Exceeded-Need-Help/m-p/2495413#M2886</link>
    <description>&lt;P&gt;Hi all. I have been working on the pow(x,n) question num50 on leetcode. However, I meet a memory limit exceeded error when the testcase of x =0.00001 n =2147483647 comes up. Originally, I just had two For loops running(1 for multiplication 1 for division). I changed it to a single while loop as I thought maybe the code wasnt optimised enough. As of right now though I have no idea what is causing it.&lt;/P&gt;
&lt;P&gt;class Solution(object):&lt;BR /&gt;def myPow(self, x, n):&lt;BR /&gt;i=1&lt;BR /&gt;isnegative=False&lt;BR /&gt;orivalue=x&lt;BR /&gt;if (n==0):&lt;BR /&gt;return 1&lt;BR /&gt;if (n&amp;lt;0):&lt;BR /&gt;isnegative=True&lt;BR /&gt;n=abs(n)&lt;BR /&gt;while (i&amp;lt;n): #stop when it has reached the n&lt;BR /&gt;if (2*i&amp;lt;=n): #can still square itself&lt;BR /&gt;x=x*x&lt;BR /&gt;i=i+i #power increases 1+1=2 2+2=4&lt;BR /&gt;else: #have to multiply with ori value&lt;BR /&gt;x=x*orivalue&lt;BR /&gt;i=i+1&lt;BR /&gt;if isnegative==True:&lt;BR /&gt;x=1/x&lt;BR /&gt;return x&lt;/P&gt;</description>
    <pubDate>Wed, 19 Mar 2025 21:46:28 GMT</pubDate>
    <dc:creator>asolbri2</dc:creator>
    <dc:date>2025-03-19T21:46:28Z</dc:date>
    <item>
      <title>Memory Limit Exceeded-Need Help</title>
      <link>https://community.qlik.com/t5/Data-Movement-Streaming/Memory-Limit-Exceeded-Need-Help/m-p/2495413#M2886</link>
      <description>&lt;P&gt;Hi all. I have been working on the pow(x,n) question num50 on leetcode. However, I meet a memory limit exceeded error when the testcase of x =0.00001 n =2147483647 comes up. Originally, I just had two For loops running(1 for multiplication 1 for division). I changed it to a single while loop as I thought maybe the code wasnt optimised enough. As of right now though I have no idea what is causing it.&lt;/P&gt;
&lt;P&gt;class Solution(object):&lt;BR /&gt;def myPow(self, x, n):&lt;BR /&gt;i=1&lt;BR /&gt;isnegative=False&lt;BR /&gt;orivalue=x&lt;BR /&gt;if (n==0):&lt;BR /&gt;return 1&lt;BR /&gt;if (n&amp;lt;0):&lt;BR /&gt;isnegative=True&lt;BR /&gt;n=abs(n)&lt;BR /&gt;while (i&amp;lt;n): #stop when it has reached the n&lt;BR /&gt;if (2*i&amp;lt;=n): #can still square itself&lt;BR /&gt;x=x*x&lt;BR /&gt;i=i+i #power increases 1+1=2 2+2=4&lt;BR /&gt;else: #have to multiply with ori value&lt;BR /&gt;x=x*orivalue&lt;BR /&gt;i=i+1&lt;BR /&gt;if isnegative==True:&lt;BR /&gt;x=1/x&lt;BR /&gt;return x&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 21:46:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Movement-Streaming/Memory-Limit-Exceeded-Need-Help/m-p/2495413#M2886</guid>
      <dc:creator>asolbri2</dc:creator>
      <dc:date>2025-03-19T21:46:28Z</dc:date>
    </item>
  </channel>
</rss>

