Back

Version 0

11/7/2024

export default async function handler(req) {
try {
const result = await (async () => {
function fibonacci() {
let a = 0, b = 1;
let lowestThreeDigit;
while (b < 1000) {
if (b >= 100 && b < 1000) {
lowestThreeDigit = b;
}
let temp = b;
b = a + b;
a = temp;
}
return lowestThreeDigit;
}

fibonacci();
})();
return Response.json({ success: true, result });
} catch (error) {
return Response.json({
success: false,
error: error.message
}, { status: 500 });
}
}
dhvanil-val_ftrpmzznmj.web.val.run
Updated: November 7, 2024