0% found this document useful (0 votes)
9 views25 pages

Trendy Weeknight Dinner Recipes

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views25 pages

Trendy Weeknight Dinner Recipes

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

05/01/2026, 09:39 Example chat: Ask anything

Suggest trendy recipes for a quick weeknight dinner

Here are trendy, weeknight-friendly dinner ideas that are big right now and still fast
(most ~20–30 minutes):

🌮 Global-Inspired & Viral Favorites


Gochujang Honey Chicken Bowls
Sweet-spicy chicken, rice, cucumbers, and a drizzle of mayo or yogurt sauce.
Birria-Style Skillet Tacos (shortcut version)
Shredded rotisserie chicken simmered with chili paste and spices, pan-fried in
tortillas.
Creamy Tuscan Gnocchi
Shelf-stable gnocchi, sun-dried tomatoes, spinach, garlic, and cream or coconut milk.
Chili Crisp Noodles
Noodles tossed with chili crisp, soy sauce, butter, and a jammy egg.

🥗 High-Protein, Feel-Good Meals


Salmon Rice Bowl (TikTok-style)
Flaked salmon, rice, avocado, cucumber, soy sauce, and spicy mayo.
Cottage Cheese Alfredo Pasta
Blended cottage cheese + garlic + Parmesan = high-protein creamy sauce.
Turkey Smash Burgers
Thin patties cooked hot and fast, served on buns or lettuce wraps.

🧀 Comfort Food, Updated


Baked Feta Pasta (still going strong)
Add roasted cherry tomatoes, spinach, and chili flakes.
Cheeseburger Quesadillas
Ground beef, cheddar, pickles, and burger sauce inside crispy tortillas.
French Onion Chicken Skillet
Caramelized onions, seared chicken, melted Gruyère.

🥦 Plant-Forward & Flexitarian


Crispy Tofu Lettuce Wraps
Air-fried or pan-seared tofu with hoisin or peanut sauce.

[Link] 1/25
05/01/2026, 09:39 Example chat: Ask anything

Harissa Chickpea Flatbreads


Store-bought naan, spicy chickpeas, yogurt drizzle, herbs.
Miso-Glazed Mushrooms over Rice
Savory, umami-packed, and super quick.

⏱️ Ultra-Fast (15–20 min)


Pesto Tortellini with Burrata
Shrimp Stir-Fry with Ginger & Garlic
Rotisserie Chicken Wraps with Green Goddess Sauce

If you want, I can:

tailor this to vegetarian / high-protein / kid-friendly


give 5-ingredient versions
or build a one-week trendy meal plan + grocery list 🛒

how do I change the minimize close icons location to


right like mac in my linux mint
I am using compize..
linux mint with mate interface

On Linux Mint MATE (even when using Compiz), the window button position is still
controlled by Marco, the window decorator. You can move the minimize / maximize /
close buttons to the right (macOS-style) very easily.

✅ Method 1: Terminal (fastest & recommended)


Open a terminal and run:

bash

gsettings set [Link] button-layout ':minimize,maximize,clo


Copy code

What this means


Left of : → buttons on the left (empty here)
Right of : → buttons on the right
[Link] 2/25
05/01/2026, 09:39 Example chat: Ask anything

Order is exactly how they appear

Mac-like order (right side):

arduino

minimize | maximize | close


Copy code

🔄 To revert to default (Linux-style left buttons)


bash

gsettings reset [Link] button-layout


Copy code

✅ Method 2: GUI (no terminal)


1. Open Control Center
2. Go to Windows
3. Under Titlebar Buttons, choose:
Right
4. Apply and close

This works even if Compiz is enabled because Marco still draws the titlebar.

🧠 If you’re using Compiz Window Decoration plugin


Just make sure:
CompizConfig Settings Manager
→ Window Decoration
→ Command is:

bash

/usr/bin/marco --replace
Copy code

(That’s the default on Mint MATE.)

[Link] 3/25
🎯 Bonus: True macOS-style (colors + spacing)
05/01/2026, 09:39 Example chat: Ask anything

If you want it to look more mac-like:

Use Themes → Mint-Y-Dark / Mint-Y-Mac


Or install McMojave / Mojave-CT themes

If you want:
macOS-style left buttons instead
or a custom order
or help switching from Marco to another decorator

just tell me 👍

i := start
for ;i < len(inorder); i++ {
if inorder[i] == root {
break
}
}

will this work in golang ?

Yes — this code is 100% valid Go (Golang) ✅


…and it behaves exactly how you expect.

Your snippet:

go

i := start
for ; i < len(inorder); i++ {
if inorder[i] == root {
break

Copy code
[Link] 4/25
05/01/2026, 09:39 Example chat: Ask anything
Copy code
}
}

Why it works
Go allows a for loop in this form:

go

for init; condition; post {


}
Copy code

but the init part is optional.


Since you already initialized i := start before the loop, you can leave the init
section empty:

go

for ; condition; post { }


Copy code

That’s exactly what you did.

Equivalent forms
Your code is equivalent to either of these:

go

for i = start; i < len(inorder); i++ { ... }


Copy code

or

go

for i < len(inorder) {


...
i++
}
Copy code

But your version is the cleanest and idiomatic when i is initialized earlier.

One thing to watch out for


[Link] 5/25
05/01/2026, 09:39 Example chat: Ask anything

If root is not found, the loop ends with:

go

i == len(inorder)
Copy code

So if you later use inorder[i] , you must guard it:

go

if i == len(inorder) {
// root not found
}
Copy code

Performance tip (important for trees)


Since this looks like a binary tree from inorder traversal, this loop is O(n) each time.
In recursive tree construction this becomes O(n²).

The optimized Go approach is:

go

index := make(map[int]int)
for i, v := range inorder {
index[v] = i
}
Copy code

Then instead of looping:

go

i := index[root]
Copy code

which makes the whole algorithm O(n) 🚀

If you're building a tree from inorder + preorder or postorder , tell me — I can show
you the fully optimized Go solution.

[Link] 6/25
05/01/2026, 09:39 Example chat: Ask anything

/**
* Definition for a binary tree node.
* type TreeNode struct {
* Val int
* Left *TreeNode
* Right *TreeNode
*}
*/
func buildTree(preorder []int, inorder []int) *TreeNode {
return helper(preorder, inorder, 0, 0, len(preorder) - 1)
}

func helper(preorder []int, inorder []int, ind int, start int,


end int) *TreeNode {
if start > end {
return nil
}

var root *TreeNode;


[Link] = preorder[ind]
i := start
for ;i < len(inorder); i++ {
if inorder[i] == [Link] {
break
}
}

[Link] = helper(preorder, inorder, ind + 1, start, i-1)


[Link] = helper(preorder, inorder, ind + 1, i+1, end)

return root

Your logic idea is correct, but this Go code will panic and also build the wrong tree.
Let’s fix it cleanly and make it fast enough for LeetCode.

❌ Problems in your code


[Link] 7/25
1️⃣
05/01/2026, 09:39 Example chat: Ask anything

root is nil → panic

go

var root *TreeNode


[Link] = preorder[ind] // 💥 nil pointer dereference
Copy code

You must allocate it:

go

root := &TreeNode{Val: preorder[ind]}


Copy code

2️⃣ Wrong preorder index for right subtree


You used:

go

[Link] = helper(preorder, inorder, ind + 1, start, i-1)


[Link] = helper(preorder, inorder, ind + 1, i+1, end)
Copy code

This is wrong ❌
The right subtree root is NOT ind+1 .

It must skip all nodes used by the left subtree.

Left subtree size:

ini

leftSize = i - start
Copy code

So:

ini

rightRootIndex = ind + 1 + leftSize


Copy code

3️⃣ Your inorder search is O(n²)


[Link] 8/25
05/01/2026, 09:39 Example chat: Ask anything

You search inorder every recursion. This TLEs on LeetCode.

We must precompute indices.

✅ Correct & Optimized Go Solution


This is the LeetCode-accepted solution:

go

func buildTree(preorder []int, inorder []int) *TreeNode {


index := make(map[int]int)
for i, v := range inorder {
index[v] = i
}
return helper(preorder, 0, 0, len(inorder)-1, index)
}

func helper(preorder []int, preStart int, inStart int, inEnd int, index map
if inStart > inEnd {
return nil
}

rootVal := preorder[preStart]
root := &TreeNode{Val: rootVal}

mid := index[rootVal]
leftSize := mid - inStart

[Link] = helper(preorder, preStart+1, inStart, mid-1, index)


[Link] = helper(preorder, preStart+1+leftSize, mid+1, inEnd, index

return root
}
Copy code

🧠 Why this works


Preorder:

sql

[Link] 9/25
05/01/2026, 09:39 Example chat: Ask anything

Copy code
root | left subtree | right subtree

Inorder:

sql

left subtree | root | right subtree


Copy code

So:

preStart = root index


mid splits inorder

leftSize tells us how many nodes belong to left subtree

right subtree root = preStart + 1 + leftSize

⏱️ Complexity
Time: O(n)
Space: O(n) (hashmap + recursion)

This is exactly what interviewers and LeetCode expect.

If you want, I can also show:


the iterative stack version
or the postorder + inorder version
or help you visualize it step by step

make changes in my code without optimizing it.. that I


will do later

Got it — we’ll only fix correctness, not optimize yet 👍


Here is your code, corrected with minimal changes.

✅ Fixed version of your code


[Link] 10/25
05/01/2026, 09:39 Example chat: Ask anything

go

func buildTree(preorder []int, inorder []int) *TreeNode {


return helper(preorder, inorder, 0, 0, len(inorder)-1)
}

func helper(preorder []int, inorder []int, ind int, start int, end int) *Tr
if start > end {
return nil
}

// FIX 1: allocate the node


root := &TreeNode{Val: preorder[ind]}

// find root in inorder


i := start
for ; i <= end; i++ {
if inorder[i] == [Link] {
break
}
}

// number of nodes in left subtree


leftSize := i - start

// FIX 2: correct preorder indices


[Link] = helper(preorder, inorder, ind+1, start, i-1)
[Link] = helper(preorder, inorder, ind+1+leftSize, i+1, end)

return root
}
Copy code

🔧 What was fixed


1️⃣ root was nil

You had:

go

[Link]
d 11/25
05/01/2026, 09:39 Example chat: Ask anything
Copy code

var root *TreeNode


[Link] = ...

That crashes.

Fixed to:

go

root := &TreeNode{Val: preorder[ind]}


Copy code

2️⃣ Right subtree root index was wrong


You had:

go

[Link] = helper(preorder, inorder, ind+1, i+1, end)


Copy code

That reuses the left subtree’s root ❌


Fixed to:

go

[Link] = helper(preorder, inorder, ind+1+leftSize, i+1, end)


Copy code

3️⃣ Search limited to current inorder slice


Changed:

go

for ; i < len(inorder); i++


Copy code

to

go

for ; i <= end; i++


Copy code

[Link] 12/25
05/01/2026, 09:39 Example chat: Ask anything

This prevents scanning irrelevant parts of inorder.

Your recursion logic is now correct and working.


When you're ready, we can optimize it to O(n) 🚀

or can we pass pointer of the idx/ind variable

Yes — you absolutely can pass ind by pointer, and it actually makes the code cleaner
for preorder traversal 👍
This avoids all the tricky index arithmetic you were just fighting with.

Here is your same approach, rewritten using an *int preorder pointer, no


optimization, no hashmap, just correctness.

✅ Your code using preorder index pointer


go

func buildTree(preorder []int, inorder []int) *TreeNode {


ind := 0
return helper(preorder, inorder, &ind, 0, len(inorder)-1)
}

func helper(preorder []int, inorder []int, ind *int, start int, end int) *T
if start > end {
return nil
}

// create root from current preorder index


root := &TreeNode{Val: preorder[*ind]}
*ind++ // move preorder pointer

// find root in inorder


i := start
for ; i <= end; i++ {

[Link] 13/25
05/01/2026, 09:39 Example chat: Ask anything

if inorder[i] == [Link] {
break
}
}

// build left subtree


[Link] = helper(preorder, inorder, ind, start, i-1)

// build right subtree


[Link] = helper(preorder, inorder, ind, i+1, end)

return root
Copy code
}

🧠 Why this works


Preorder always goes:

css

root → left subtree → right subtree


Copy code

So you just:
1. Take the next preorder value as root
2. Build left subtree (it consumes preorder values)
3. Then build right subtree (continues where left stopped)

This is exactly how the recursion should flow — no index math needed.

⚠️ Important Go syntax fix


You must write:

go

(*ind)++
Copy code

NOT

go

[Link] 14/25
05/01/2026, 09:39 Example chat: Ask anything

Copy code
*ind++

So the correct line is:

go

(*ind)++
Copy code

🎯 This version is:


Easier to reason about
Harder to mess up
Same time complexity as your original (O(n²))
Very popular in interviews

If you want, next we can optimize it with a hashmap and make it O(n) 🚀

now when we passed the idx as pointer it worked,, but


was not working earlier
why ?

This is a great question — and understanding this means you’ve basically mastered how
preorder tree building really works 👌
Let’s break it down simply.

🧠 What preorder recursion really needs


Preorder traversal is:

css

root → left subtree → right subtree


Copy code

That means:

[Link] 15/25
05/01/2026, 09:39 Example chat: Ask anything

Every recursive call must consume preorder elements in sequence — globally.

There is one moving pointer through the preorder array.

❌ What went wrong in your original code


You used:

go

helper(preorder, inorder, ind+1, ...)


Copy code

Each recursive call got its own copy of ind .

So the recursion tree looked like this:

scss

root(0)
├── left(1)
└── right(1) ❌ WRONG — should be after left subtree Copy code

Both left and right subtrees started from ind+1 ,


but preorder requires:

scss

root(0)
├── left(1 ... k)
└── right(k+1 ...)
Copy code

You tried to fix this with:

go

ind + 1 + leftSize
Copy code

but that depends on perfect math and is very easy to break.

✅ Why pointer version works


Now you did:
[Link] 16/25
05/01/2026, 09:39 Example chat: Ask anything

go

ind := 0
helper(..., &ind, ...)
Copy code

Now all recursive calls share the same ind .

So execution becomes:

sql

ind = 0 → root
ind = 1 → left root
ind = 2 → left-left
...
when left finishes, ind is now correct for right
Copy code

The left subtree automatically advances the preorder index.


The right subtree just continues.

This perfectly matches preorder traversal.

🧠 Think of it like a file cursor


ind is like a file pointer:

Without pointer:

every function gets its own copy → everyone starts reading from page 2 ❌
With pointer:

everyone shares the same cursor → reading happens in correct order ✅

🎯 Summary
Approach Why it failed / worked

ind+1 passing Each recursion had its own index → preorder sequence breaks

[Link] 17/25
05/01/2026, 09:39 Example chat: Ask anything

Approach Why it failed / worked

*int pointer One global moving index → preorder stays correct ✅

You accidentally discovered the cleanest recursive pattern for tree construction — this
is how it's done in serious interviews 👏

final

/**
* Definition for a binary tree node.
* type TreeNode struct {
* Val int
* Left *TreeNode
* Right *TreeNode
*}
*/
func buildTree(preorder []int, inorder []int) *TreeNode {
idx := 0
inOrderMap := make(map[int]int)
for i := 0; i < len(inorder); i++ {
inOrderMap[inorder[i]] = i
}
return helper(preorder, inOrderMap, &idx, 0,
len(preorder) - 1)
}

func helper(preorder []int, inOrderMap map[int]int, idx


*int, start int, end int) *TreeNode {
if start > end {
return nil
}

root := &TreeNode{Val: preorder[*idx]}


i := inOrderMap[[Link]]
*idx++
[Link] = helper(preorder, inOrderMap, idx, start, i-1)

[Link] 18/25
05/01/2026, 09:39 Example chat: Ask anything

[Link] = helper(preorder, inOrderMap, idx, i+1,


end)

return root

Nice — this is the canonical, optimal solution 👌


Just one tiny Go syntax bug to fix, otherwise your logic is perfect.

❌ Bug
This line is wrong in Go:

go

*idx++
Copy code

Go parses it as:

go

*(idx++)
Copy code

which is illegal — you can’t increment a pointer.

✅ Correct version
You must write:

go

(*idx)++
Copy code

🧩 Final corrected code


go

[Link] 19/25
05/01/2026, 09:39 Example chat: Ask anything

func buildTree(preorder []int, inorder []int) *TreeNode {


idx := 0

inOrderMap := make(map[int]int)
for i := 0; i < len(inorder); i++ {
inOrderMap[inorder[i]] = i
}

return helper(preorder, inOrderMap, &idx, 0, len(inorder)-1)


}

func helper(preorder []int, inOrderMap map[int]int, idx *int, start int, en


if start > end {
return nil
}

root := &TreeNode{Val: preorder[*idx]}


mid := inOrderMap[[Link]]

(*idx)++ // advance preorder pointer

[Link] = helper(preorder, inOrderMap, idx, start, mid-1)


[Link] = helper(preorder, inOrderMap, idx, mid+1, end)

return root Copy code

🎯 What you now have


Correct preorder consumption
O(n) time complexity
O(n) space
LeetCode-approved
Interview-grade solution

You started with a broken recursive tree and ended with a textbook optimal solution
— well done 👏

[Link] 20/25
05/01/2026, 09:39 Example chat: Ask anything

lets dry run for


Input: preorder = [3,9,20,15,7], inorder = [9,3,15,20,7]
Output: [3,9,20,null,null,15,7]

Perfect test case — let’s dry-run your exact code step-by-step so you can see why the
pointer method works.

Input

ini

preorder = [3, 9, 20, 15, 7]


inorder = [9, 3, 15, 20, 7]
Copy code

Inorder index map:

9→0, 3→1, 15→2, 20→3, 7→4


Copy code

We call:

arduino

idx = 0
helper(preorder, map, &idx, 0, 4)
Copy code

🧩 Step-by-step
Call 1: build root

makefile

idx = 0
root = preorder[0] = 3
mid = inorder[3] = 1
idx++ → idx = 1
Copy code

Split inorder:
[Link] 21/25
05/01/2026, 09:39 Example chat: Ask anything

ini

Left = [9] (0..0)


Right = [15,20,7] (2..4)
Copy code

markdown

3
/ \
? ?
Copy code

Call 2: build LEFT of 3 (0..0)

makefile

idx = 1
root = preorder[1] = 9
mid = inorder[9] = 0
idx++ → idx = 2
Copy code

Left: empty
Right: empty

markdown

3
/ \
9 ?
Copy code

So 9 is a leaf.

Call 3: build RIGHT of 3 (2..4)

makefile

idx = 2
root = preorder[2] = 20
mid = inorder[20] = 3
idx++ → idx = 3
Copy code

[Link] 22/25
05/01/2026, 09:39 Example chat: Ask anything

Split inorder:

ini

Left = [15] (2..2)


Right = [7] (4..4)
Copy code

markdown

3
/ \
9 20
/ \
? ?
Copy code

Call 4: build LEFT of 20 (2..2)

makefile

idx = 3
ChatGPT 5.2
root = preorder[3] = 15
mid = inorder[15] = 2
idx++ → idx = 4
Copy code

Leaf node.

markdown

3
/ \
9 20
/
15
Copy code

Call 5: build RIGHT of 20 (4..4)

makefile

idx = 4
root = preorder[4] = 7

[Link] 23/25
05/01/2026, 09:39 Example chat: Ask anything

mid = inorder[7] = 4
Copy code
idx++ → idx = 5

Leaf node.

markdown

3 Copy code

/ \
9 20
/ \
15 7

✅ Final Tree
Level order (LeetCode format):

graphql Copy code

[3, 9, 20, null, null, 15, 7]

Matches expected output ✔

🔥 Why pointer idx is magical

Notice:
We never calculated where the right subtree starts.
Left subtree recursion automatically advanced idx .
When left finishes, idx is already pointing to the correct right root.

This is exactly how preorder traversal flows.

You now understand this algorithm better than most interviewees 😄

[Link] 24/25
05/01/2026, 09:39 Example chat: Ask anything

[Link] 25/25

You might also like