It was just like coach Luke Walton drew it up. With five seconds left and his team trailing one, rookie Brandon Ingram found Nick Young for a three-point bomb that lifted the Los Angeles Lakers to a 111-109 home win on Tuesday.

Except, it wasn’t like Walton drew it up. Not even close.

With eight ticks remaining, Ingram thought he found Lou Williams at the top of the arc for a wide-open three-pointer. And he did, indeed, find him. The ball was going to Williams. Ingram’s passing skills aren’t compromised.

It’s just that Young took a page out of Seattle Seahawks cornerback Richard Sherman’s book and picked Ingram off before hoisting up — in full Swaggy P fashion — an improbable, game-winning triple.

But whether he knows it or not, there was a touch of brilliance in his abrupt cut in front of Williams down the stretch.

The rookie declines Swaggy P

Here the play is taking shape. Williams and Jordan Clarkson flare up top, while Larry Nance, Jr. pops out to provide an easy inbounds option. You can see Young calling for the ball in the short corner, where he shoots 33 percent on the season.

Russell Westbrook is loosely, but attentively guarding him. This season, guys are shooting 9 percent better in the fourth quarter against Westbrook than they normally do. So that shot may have dropped.

But Ingram declines Young and gets the ball back from Nance on the inbound.

Young gets rejected again

Now, the play starts to unfold. Ingram takes the ball back from Nance and hands it off to Williams. Nance easily could have screened Westbrook here, which may have freed Swaggy P on the flare for an open look from deep.

But again, he’s declined.

Young stays active, though. When it appears Ingram is shooting the three, the soon-to-be savior, for a second, starts to attack the glass.

Then, Ingram puts the ball on the floor, which sets the scene for an improbable Lakers finish.

The moment of truth discombobulated the Thunder’s defense

“It was a little confusing,” Thunder guard Victor Oladipo said of his team’s communication on Young’s game-winning shot. “It seemed like I was guarding three people at one time. He kind of came outta nowhere.”

Oladipo has a point.

Had Jerami Grant not bitten on Ingram’s pump fake, Oklahoma City may have walked away with the win.

But he did. And because he did, you’ll see Oladipo leave Lou Williams to double on the drive.

And as brash a cut as Young made, there was some genius to it. Watch Oladipo close out to Williams instead of Young, who was already in a shooting motion by the time the closest defender arrived. In reality, it’s Westbrook who should have been playing his man instead of snoozing in the paint.

Westbrook was checking Young on the game’s final play. So when Swaggy P broke protocol and cut across Williams, Westbrook should have stayed with him. Oladipo had the right idea finding his own guy, just the wrong timing.

The Lakers only needed a two to win, a free throw to tie, so the Thunder defended the paint, and rightfully so. But Young’s unscripted, play-breaking cut threw both sides so far off, it actually worked.

Walton will probably say the play was executed as drawn out. But it’s Swaggy P’s impromptu heroics that landed the Lakers their eighth win on the year.