Search through our collection of stories, ideas, and insights from creators around the world.
import express from "express"; import OpenAI from "openai"; const app = express(); app.use(express.json()); const openai = new OpenAI({ apiKey: "YOUR_API_KEY" }); app.post("/generate", async (req, res) => { const { topic } = req.body; const response = await openai.chat.completions.create({ model: "gpt-4o-mini", messages: [ { role: "user", content: `Write a blog on ${topic}` } ], }); res.json({ blog: response.choices[0].message.content }); }); app.listen(3000, () => console.log("Server running"));
Read More
class Solution { public boolean solveSudoku(char[][] board) { return solve(board); } private boolean solve(char[][] board) { for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (board[i][j] == '.') { for (char c = '1'; c <= '9'; c++) { if (isValid(board, i, j, c)) { board[i][j] = c; if (solve(board)) return true; board[i][j] = '.'; // backtrack } } return false; } } } return true; } private boolean isValid(char[][] board, int row, int col, char c) { for (int i = 0; i < 9; i++) { // row check if (board[row][i] == c) return false; // column check if (board[i][col] == c) return false; // 3x3 box check int r = 3 * (row / 3) + i / 3; int c2 = 3 * (col / 3) + i % 3; if (board[r][c2] == c) return false; } return true; } }
Read More
udoku solve karne ka best way = Backtracking Idea: Empty cell (. ya 0) find kar 1–9 try kar Check valid hai ya nahi Valid → place → recursion Nahi → backtrack (undo) 📊 Sudoku Rules Row me duplicate nahi Column me duplicate nahi 3x3 box me duplicate nahi
Read More
Day 1 – Chest + Triceps Bench Press Push-ups Tricep Dips Day 2 – Back + Biceps Day 3 Pull-ups / Lat Pulldown Barbell Row Bicep Curls Day 3 – Legs Squats Lunges Leg Press Day 4 – Shoulders Shoulder Press Lateral Raises Day 5 – Full Body / Cardio 👉 Rest 1–2 days
Read More