<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Braden Ripple on Medium]]></title>
        <description><![CDATA[Stories by Braden Ripple on Medium]]></description>
        <link>https://medium.com/@bradenripple?source=rss-69b693108a14------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SFlk5HR-yY2NVIRt.jpg</url>
            <title>Stories by Braden Ripple on Medium</title>
            <link>https://medium.com/@bradenripple?source=rss-69b693108a14------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 06:58:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bradenripple/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[h]]></title>
            <link>https://medium.com/@bradenripple/h-f7978d8f2876?source=rss-69b693108a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7978d8f2876</guid>
            <dc:creator><![CDATA[Braden Ripple]]></dc:creator>
            <pubDate>Fri, 16 May 2025 06:12:02 GMT</pubDate>
            <atom:updated>2025-05-16T06:12:02.684Z</atom:updated>
            <content:encoded><![CDATA[<p>h</p><p>sx</p><p>,</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7978d8f2876" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You have no friends. Derive the Powerset of all groups of friends all on your own.]]></title>
            <link>https://medium.com/@bradenripple/you-have-no-friends-derive-the-powerset-of-all-groups-of-friends-all-on-your-own-338577cb3d28?source=rss-69b693108a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/338577cb3d28</guid>
            <dc:creator><![CDATA[Braden Ripple]]></dc:creator>
            <pubDate>Tue, 18 Apr 2023 23:54:18 GMT</pubDate>
            <atom:updated>2023-04-19T00:02:15.984Z</atom:updated>
            <content:encoded><![CDATA[<p>Best example I can think of is first day in class. You don’t know anybody. This is the empty set, written in python as []. But if you look outside yourself you realize, making this is a group in itself, we’d make the set of the empty set. So pythonwise, the set of all possible groups friends is <em>[[]]</em>. Confusing enough? Well now you have a friend, namely, yourself. so it becomes [[],[you]]. But then, you get some courage maybe you ask your neighbor about this article thereby befriending your neighbor so then you go from [[],[you]] + neighbor =&gt;[[neighbor],[you,neighbor]]. But wait, we must keep the memory of what he had initially [[],[you]]. Don’t forget where you came from right? Combine [[],[you]] with [[neighbor],[you,neighbor]] and then get [[],[you],[neighbor],[you,neighbor]]. See a pattern here? The powerset for each additional friend doubles each time and we actually create the powerset for each person we add. So if you get this process now you can do the same thing with each additional person, call it neighbor2, etc. so</p><p>[[],[you],[neighbor],[you,neighbor]]</p><p>begats</p><p>[[],[you],[neighbor],[you,neighbor],[[neighbor2],[you,neighbor2],[neighbor,neighbor2],[you,neighbor,neighbor2]]</p><p>adding neighbor3, begats</p><p>[[], [you], [neighbor], [you, neighbor], [neighbor2], [you, neighbor2], [neighbor, neighbor2], [you, neighbor, neighbor2], [neighbor3], [you, neighbor3], [neighbor, neighbor3], [you, neighbor, neighbor3], [neighbor2, neighbor3], [you, neighbor2, neighbor3], [neighbor, neighbor2, neighbor3], [you, neighbor, neighbor2, neighbor3]], etc.</p><p>I even used the code below to generate that last iteration.</p><p>So if you got nothing else out of this, maybe you need to start out by being your own friend. Here’s the code in python.</p><pre>def powerSet(s):<br>    sets = [[]]<br>    for i in s:<br>        newsets = []<br>        for k in sets:<br>            newsets.append(k+[i])<br>        sets += newsets<br>    return sets<br><br>friends = [&quot;you&quot;,&quot;neighbor&quot;,&quot;neighbor2&quot;,&quot;neighbor3&quot;]<br><br>print(str(powerSet(friends)).replace(&quot;&#39;&quot;,&quot;&quot;))</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=338577cb3d28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Next Time You Interview for a MAANG/FAANG Company Know This]]></title>
            <link>https://medium.com/@bradenripple/next-time-you-interview-for-a-maang-faang-company-know-this-9db9a4fd34a2?source=rss-69b693108a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/9db9a4fd34a2</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[binary-tree]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Braden Ripple]]></dc:creator>
            <pubDate>Tue, 01 Nov 2022 07:37:27 GMT</pubDate>
            <atom:updated>2022-11-01T08:13:39.827Z</atom:updated>
            <content:encoded><![CDATA[<p>You might already know this, but the one question that is probably asked the most when it comes to developer jobs, is dealing with binary trees. The last question I was asked in my last interview with Amazon was verbatim question 114 of leetcode <a href="https://leetcode.com/problems/flatten-binary-tree-to-linked-list/description/">https://leetcode.com/problems/flatten-binary-tree-to-linked-list/description/</a>.</p><p>My two goals here are to provide useful information and to explain code in the simplest yet concise way possible.</p><p>The question is this:</p><blockquote>Given the root of a binary tree, flatten the tree into a &quot;linked list&quot;:</blockquote><blockquote>The “linked list” should use the same TreeNode class where the right child pointer points to the next node in the list and the left child pointer is always null.</blockquote><blockquote>The “linked list” should be in the same order as a <a href="https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR"><strong>pre-order traversal</strong></a> of the binary tree.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*K-AfOWDeF291YinTaL8Ijw.jpeg" /></figure><p>To express this visually, we’re trying to go to from the form on the left to the form on the right, and not create any new links or new objects of another class or any new instances of TreeNode either so that when we’re done we only have links from one right node to the next. I.e., a TreeNode object in python would look like this</p><pre>class TreeNode:<br> val: int<br> left: TreeNode<br> right: TreeNode</pre><p>Here’s my code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i7nv3hW64lMhJ6sGt1BynA.png" /></figure><p>if the tree was already flattened, we’d iterate through the whole while loop without ever running the if statement. In the case we do have a left node, we make a copy of it, <em>shown in line 10</em>, then if that node has a right node we then go to that, and repeat until the right node is empty. In this case, <em>i.e. line 13</em>, we make this descendant node the parent of <em>node.right, </em>node itself being what initially called in line 6. Then once we make this connection, we just make node.right equal to node.left and get rid of node.left.</p><p>So to summarize, traversing to the right, whenever we encounter a left node we can’t just shove it between the existing node and it’s right node, we must iterate all the way down to the rightmost node of the left node and use that to complete the connection, and then make that left node the right node and make the left null as shown in lines 14 and 15.</p><p>If this doesn’t make sense please email me at bradenripple@gmail.com. I will be more than willing to explain it. I’m sorry there aren’t better visuals in this article to explain what I’m talking about perhaps this can be done using codepen or my own site.. as coders our jobs is to not just think outside the box, but actually materialize what’s outside it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9db9a4fd34a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enumerating all permutations of a Pocket Cube using Golang.]]></title>
            <link>https://medium.com/@bradenripple/enumerating-all-possible-combinations-of-a-pocket-cube-using-golang-ad80d7af23b?source=rss-69b693108a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad80d7af23b</guid>
            <category><![CDATA[rubiks-cube]]></category>
            <category><![CDATA[combinatorics]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Braden Ripple]]></dc:creator>
            <pubDate>Tue, 12 Jul 2022 23:21:54 GMT</pubDate>
            <atom:updated>2022-07-21T21:23:51.982Z</atom:updated>
            <content:encoded><![CDATA[<p>If you just want to see the code it is here, <a href="https://sites.google.com/site/bradenrippleresume/pocket-cube-code">https://sites.google.com/site/bradenrippleresume/pocket-cube-code</a></p><p>So, when it comes to solving a rubik’s cube, you generally have two types of people, sometimes 3 if you’re taking into to account a combination of the two types, and maybe 4 if you’re considering those who are not at all interested. Anyhow, semantics aside, the two types here are those who are into trying to solve it quickly by hand and maybe have some way of coming up with a quick solution versus those who are interested purely in the computational aspects of this problem and are looking for more optimal solutions if not the most optimal. I’d imagine it’s mostly this last type that might be interested here.</p><p>The one way I know of to come up with the most optimal solution for any rubik’s cube, is to enumerate all possibilities, which if you think about it makes sense because at each step you’re checking to see if each configuration has already been produced. The total number of enumerations, i.e. different ways a pocket cube can be rotated is (3⁷ * 8!)/24, reason being that there 8 factorial ways to position each of the eight cubes, 3⁷ ways to rotate each cube of the 7 cubes independent of the first placed cube which can be rotated 3 ways and positioned 8, making 24 different versions of the pocket cube. However, only one of those 24 will look like it’s solvable.</p><p>There perhaps some of you who are either don’t understand that last paragraph or don’t believe. That’s ok, This can be shown computationally.</p><p>But first, we have to consider running the code in itself. This code is in Golang, posted above. If you have some way to optimize this please send me a link or post it here, I would be more than willing to repost it. Initially writing this code in Python, then in Java, not able to use malloc in C++ and then using Golang, then trying to find a way to write this using matrix and tensor operations in Tensorflow, though the linear transformations in tensorflow are seemingly much more elegant, etc. etc., I’ve come to realize the nearly infinite ways one can beat this dead horse. The fastest I’ve been able to get this to run is in 35 seconds on a macbook pro.</p><p>This doesn’t generate the actual algorithm for each permutation, but could be modified to do so if you were to make an extra hashmap specifically for each individual set of rotations, i.e. adding to the rotations needed for each previous round of configurations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad80d7af23b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>